March 2018
Beginner
616 pages
16h 53m
English
After reading lesson 18, you’ll be able to
In this unit so far, we’ve discussed how types can be added and multiplied, like data. Like functions, types can also take arguments. Types take arguments by using type variables in their definitions (so their arguments are always other types). Types defined using parameters are called parameterized types. Parameterized types perform an important role in Haskell, as they allow you to define generic data structures that work with a wide range of existing data.
Suppose you want to create a type representing a pair ...