O'Reilly logo

Get Programming with Haskell by Will Kurt

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

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 ...

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