13 More about types

This chapter covers

  • Using types to direct processing stages
  • Using types to implement safe interfaces
  • Programming with dependent types in Haskell

We’ve discussed a lot of powerful Haskell features in the previous chapters. To keep the presentation simple, I tried to talk about them in isolation. Their powers become much stronger, however, when we use them in combination. We can achieve a huge boost in the expressiveness of our types together with the provable safety of our programs if we apply types, type classes, type families, GADTs, and Template Haskell at once. In this chapter, I demonstrate how we can do that in two extended examples.

In the first section we’ll explore the usage of type families and type classes to ...

Get Haskell in Depth 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.