ekmett/free — Issue #2: Representable instance for Cofree f is missing
Author: sjoerdvisscher
Created: 2011-11-07 17:51:26+00:00
State: open

I noticed that Cofree implements every superclass of Representable, but not Representable itself. Here's a possible instance:

instance Representable f => Representable (Cofree f) where
tabulate f = f Seq.empty :< tabulate (\k -> tabulate (f . (k Seq.<|)))