December 2021
Beginner
840 pages
47h 29m
English
Haskell has the following primitive types: fixed precision integer (Int), arbitrary precision integer (Integer), single precision real (Float), boolean (Bool), and character (Char). The type of a string is [Char] (i.e., a list of characters); the type String is an alias for [Char]. The interpreter command :type <expression> (also :t <expression>) returnsthetypeof <expression>:
Notice from lines 1–10 that Haskell uses type inference. The :: double-colon symbol associates a value with a type and is read as “is of type.” For instance, the expression a :: Char indicates that ′a′ is of type Char. This explains the ...
Read now
Unlock full access