What are some motivating examples for Cofree CoMonad in Haskell?
Let’s just recap the definition of the Cofree datatype. data Cofree f a = a :< f (Cofree f a) That’s at least enough to diagnose the problem with the example. When you wrote 1 :< [2, 3] you made a small error that’s reported rather more subtly than is helpful. Here, f = [] … Read more