O'Reilly logo

Haskell Cookbook by Yogesh Sajanikar

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

How it works...

We have seen four basic types Int, Double, Char, and Float. More information about these types is given in the following table:

Type Description Remarks
Int Fixed precision integer type

Range [-9223372036854775808 to

9223372036854775807] for 64-bit Int.

Float Single precision (32-bit) floating point number
Double Double precision (64-bit) floating point number
Char Character
Bool Boolean values True or False
Note that all types start with a capital letter.

In previous sections of this recipe, when we ran the command :info Bool, at GHCi prompt, Haskell also showed various instances of information. It shows more about the behavior of the type. For example, instance Eq Bool means that the type Bool is an ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required