Haskell/Syntactic sugar

Syntactic sugar refers to any redundant type of syntax in a programming language that is redundant to the main syntax but which (hopefully) makes the code easier to understand or write.

Functions and constructors

 * For more information, see the chapter ../More on functions/

Function Bindings

 * For more information, see the chapter ../Variables_and_functions

Lists

 * For more information, see the chapters ../Lists and tuples/, ../Lists II/, ../Lists III/, ../Understanding monads/List/ and ../MonadPlus/

Do notation

 * For more information, see the chapters ../Understanding monads/ and ../do Notation/.

Literals
A number (such as 5) in Haskell code is interpreted as, where the   is an. This allows the literal to be interpreted as,  ,   etc. Same goes with floating point numbers such as  , which are interpreted as  , where   is a. GHC has  extension, which enables the same behaviour for string types such as   and   varieties from the   modules.

Type level
The type  is equivalent to. This makes it obvious it is an application of  type constructor (kind  ) to   (kind  ).

Analogously,  is equivalent to , and the same goes with larger tuples.

Function types have the same type of sugar:  can also be written as.

Layout

 * For more information on layout, see the chapter on ../Indentation/