[BLOG] Every Distributive is Representable

It is well-known that the Distributive and Representable classes are equivalent. However, there is little commentary on the direction of the equivalence that goes from Distributive to Representable that goes beyond noting that it is non-obvious or not readily expressible through code. This post is my take at writing down an argument for why that should be the case, starting from a formulation of Distributive in terms of the duals of the traversable laws. While I half-expect there to be a more abstract categorial argument that obviates my proof strategy, exploring the connection in this manner neatly displays some of the common properties implied by either of the classes.

1 Like

As I was reading this, I thought flap seemed familiar, and now I remember why: it’s basically what this Stack Overflow question was asking for.

Exactly. As noted in the comments over there, it’s also known as (??) in lens – made infix so that we can write e.g. runState ?? initial $ do stuff.