Haskell Language Common functors as the base of cofree comonads Cofree Maybe ~~ NonEmpty


Example

Given

data Maybe a = Just a
             | Nothing

we have

data Cofree Maybe a
     = a :< Just (Cofree Maybe a)
     | a :< Nothing

which is isomorphic to

data NonEmpty a
     = NECons a (NonEmpty a)
     | NESingle a