Unit 3. Programming in types
Types in Haskell constitute their own way of writing programs. Unit 1 introduced you to the general ideas of functional programming. If this was your first introduction to functional programming, you were likely presented with an entirely new way of thinking about writing code and solving problems. Haskell’s type system is so powerful that it’s best to approach it as a second programming language that works in conjunction with what you learned in unit 1.
But what does it mean to think about programming in types? When you look at the type signature of a function—say, a -> b—you can view this signature as a description of a transformation. Suppose you have a type signature CoffeeBeans -> CoffeeGrounds; what function ...