Functortown: A Map of the Territory

This course will be a full tour of the functors. We will start by examining the motivation for functors and the Functor typeclass. From there, we’ll explore monoidal functors, bifunctors, contravariant functors, and profunctors in depth, discussing the laws and the mathematical basis for these structures along the way.

Topics covered in this course:

  • Functor, Bifunctor, Applicative, Traversable, Monad, Contravariant, and Profunctor typeclasses;
  • type constructors and higher kindedness;
  • representative instances and uses of each;
  • the laws and how to property test your instances using the hedgehog testing library.


  • knowledge of several basic types, especially Maybe, Either, tuples, and the function type;
  • basic understanding of typeclasses and their relationship with types; and
  • some facility with Haskell syntax.

Lesson plan

Part I: Functor

Part II: Bifunctor

Part III: Applicative

  • Introduction: what and why
  • Applicatives are functors!
  • What makes applicative special
  • Examples of <*> usage
  • The Applicative laws and property tests

Part IV: Traversable

  • Introduction: what and why
  • Instances
  • Connection to Applicative
  • Examples of traverse usage
  • The Traversable laws and property tests

Part V: Monad

  • Introduction: what and why
  • Instances
  • Relationship to Functor and Applicative
  • Examples of >>= usage
  • The Kleisli fish
  • The Reader newtype
  • The Monad laws and property tests
  • Transformers

Part VI: Contravariant

  • Introduction: what and why
  • What kinds of types are contravariant
  • Relationship to an earlier functor
  • Examples of contramap usage
  • The Contravariant laws and property tests

Part VII: Profunctor

  • Introduction: what and why
  • Breaking down dimap
  • What kinds of types are profunctors
  • Examples, from basic to complex
  • The Profunctor laws and property tests

Type Classes offers courses and projects to get you started and make you an expert in FP with Haskell. For $29/month, you get access to the complete archive and all the latest content.