You may recall the definition for an exponential functor from my previous entry, which can also be viewed, I suppose, as functors in the

category of right-invertible functions in Haskell.

class ExpFunctor f where xmap :: (a -> b) -> (b -> a) -> f a -> f b

Clarifying the above, an instance of ExpFunctor should satisfy the slightly generalized version of the Functor laws from Control.Monad:

xmap id id = id xmap f g . xmap f' g' = xmap (f . f') (g' . g)

Since we like to apply xmap to a pair of functions such that f . g = id, as in the Fegaras/Sheard case, we get:

xmap f g . xmap g f = xmap (f . g) (f . g) -- by second xmap law = xmap id id -- by f . g = id = id -- by first xmap law

In any event, what I thought what I'd do today is note that Wouter Swierstra's Data Types a la Carte approach works over exponential functors.