Lesson 6: More than a sum

  • Sum sometimes
  • Zippable containers
  • Alignable functors
  • Exercise instances
  • Align and merge
  • Unaligning
  • Coming up

In the previous lesson we introduced the Bifunctor class and some canonical instances, for Either and (,). We also discussed the notion of covariance and why the function type cannot be a Bifunctor. It’s easy to feel that this class is slightly pointless. But hold on, we’re not quite done.

In this lesson, we’ll consider a datatype that is something like Either plus (,) and what its Bifunctor looks like and what else this type can do for us and how those things are related to its bifunctoriality.

Sign up for access to the full page, plus the complete archive and all the latest content.