© Stefania Loredana Nita and Marius Mihailescu 2019
Stefania Loredana Nita and Marius MihailescuHaskell Quick Syntax Referencehttps://doi.org/10.1007/978-1-4842-4507-1_4

4. Types

Stefania Loredana Nita1  and Marius Mihailescu1
(1)
Bucharest, Romania
 

In Chapter 3, you saw that GHC contains predefined functions, and you worked a little with the div function. In that example, we subtly introduced types, without a comprehensive discussion. It is time to discuss them now. So, in this chapter, you’ll learn about the main types in Haskell, how you can define your own types, and how the type system in Haskell works.

Basic Types in Haskell

The following are the main types in Haskell:
  • Char represents a Unicode character.

  • Bool represents a Boolean value . There ...

Get Haskell Quick Syntax Reference: A Pocket Guide to the Language, APIs, and Library now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.