<div dir="ltr">The type<br><br><blockquote style="margin: 0 0 0 40px; border: none; padding: 0px;">Cofree (Either t) e</blockquote><br>is isomorphic to a non-empty version of <br><br style="font-family: arial, sans-serif; font-size: 12.8px;"><blockquote style="margin: 0 0 0 40px; border: none; padding: 0px;">List t e </blockquote><br>On Wednesday, November 25, 2015 at 8:00:40 PM UTC+1, Silvio Frischknecht wrote:<blockquote class="gmail_quote" style="margin: 0;margin-left: 0.8ex;border-left: 1px #ccc solid;padding-left: 1ex;">Hello,
<br>
<br>I'm interested in learning more about a list-like structure with a
<br>terminal element. I.e.
<br>
<br>data List t e = Cons e (List t e) | Null t
<br>
<br>or maybe
<br>
<br>data List t e = Cons e (List t e) | Null | Terminal t
<br>
<br>
<br>An practical application could be lazy reading from a file
<br>readFile :: String -> List Error String
<br>
<br>Obviously there is a Functor instance. There is even a Monad instance.
<br>However, it is not defined as obviously because it's not clear what the
<br>terminal element should be. There is a straight forward fold like structure.
<br>
<br>My questions are.
<br>
<br>Are there more interesting generalizations of List?
<br>What rules do they follow?
<br>How should the Monad work? Why?
<br>
<br>I know this is related to the whole Iteratee discussion (I'm not
<br>completely familiar with it).
<br>
<br>Cheers
<br>
<br>Silvio
<br>______________________________<wbr>_________________
<br>Haskell-Cafe mailing list
<br><a href="javascript:" target="_blank" gdf-obfuscated-mailto="ojiJM1yiCAAJ" rel="nofollow" onmousedown="this.href='javascript:';return true;" onclick="this.href='javascript:';return true;">Haskel...@haskell.org</a>
<br><a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/haskell-cafe" target="_blank" rel="nofollow" onmousedown="this.href='http://www.google.com/url?q\75http%3A%2F%2Fmail.haskell.org%2Fcgi-bin%2Fmailman%2Flistinfo%2Fhaskell-cafe\46sa\75D\46sntz\0751\46usg\75AFQjCNH7sFgl7KfuDcDlaGGG3ip3kRaoIA';return true;" onclick="this.href='http://www.google.com/url?q\75http%3A%2F%2Fmail.haskell.org%2Fcgi-bin%2Fmailman%2Flistinfo%2Fhaskell-cafe\46sa\75D\46sntz\0751\46usg\75AFQjCNH7sFgl7KfuDcDlaGGG3ip3kRaoIA';return true;">http://mail.haskell.org/cgi-<wbr>bin/mailman/listinfo/haskell-<wbr>cafe</a>
<br></blockquote></div>