[Haskell-cafe] Info about List with terminal element
diaz.carrete at gmail.com
Thu Nov 26 20:35:54 UTC 2015
Cofree (Either t) e
is isomorphic to a non-empty version of
List t e
On Wednesday, November 25, 2015 at 8:00:40 PM UTC+1, Silvio Frischknecht
> I'm interested in learning more about a list-like structure with a
> terminal element. I.e.
> data List t e = Cons e (List t e) | Null t
> or maybe
> data List t e = Cons e (List t e) | Null | Terminal t
> An practical application could be lazy reading from a file
> readFile :: String -> List Error String
> Obviously there is a Functor instance. There is even a Monad instance.
> However, it is not defined as obviously because it's not clear what the
> terminal element should be. There is a straight forward fold like
> My questions are.
> Are there more interesting generalizations of List?
> What rules do they follow?
> How should the Monad work? Why?
> I know this is related to the whole Iteratee discussion (I'm not
> completely familiar with it).
> Haskell-Cafe mailing list
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Haskell-Cafe