Types and classes
In this chapter we introduce types and classes, two of the most fundamental concepts in Haskell. We start by explaining what types are and how they are used in Haskell, then present a number of basic types and ways to build larger types by combining smaller types, discuss function types in more detail, and conclude with the concepts of polymorphic types and type classes.
3.1 Basic concepts
A type is a collection of related values. For example, the type Bool contains the two logical values False and True, while the type Bool → Bool contains all functions that map arguments from Bool to results from Bool, such as the ...