The names of types in Haskell always start with a capital letter, for example, Integer , not integer . You’ll learn about several different built-in types throughout this chapter, but to get started let’s take a look at a few of the most common types:

  • Integer : A signed integer value. It’s unbounded , meaning it can be arbitrarily large. Integer literals are written as numbers, as in 1234 or -1234 .

  • Int : A signed integer value. Its size (32-bit or 64-bit) depends on your platform. Int literals are written as numbers, as in 1234 or -1234 .

  • Word : An unsigned integer value. It’s the same size as an Int . Word literals are written as numbers, as in 1234 .

  • Float : A single-precision IEEE floating-point value. Float literals may be written as numbers, with or without a fractional part, as in 1 or 1.2 .

  • Double : A double-precision IEEE floating-point value.

  • Bool : A boolean value. It can be True or False .

  • Char : A single character. A character literal is written with single-quotes, as in ’A’ . Specifically, a Char is a Unicode code point.

  • String : A string. A Haskell string is a list of characters. A string literal is written with double quotes, as in "string" .

  • [Int] : A list of Int values. List types are surrounded by square brackets.

  • (Int, String) : A tuple of an Int and a String . Tuples are written as comma-separated lists of types surrounded by parentheses.

  • ([Int],(String,String,String)) : A tuple whose first element is a list of Int and whose second element is a three-tuple of String s