[Haskell] Re: ANNOUNCE: generator 0.5.1

Yair Chuchem yairchu at gmail.com
Thu Jul 16 08:14:20 EDT 2009


Sebastian Fisher wrote:

> The nested monadic tails of your lists seem more similar to the  
> nested monadic data described in the ICFP'09 paper with Oleg  
> Kiselyov and Chung-chieh Shan [1]. The ideas described in that paper  
> are on Hackage and your ListT seems similar to the List type in  
> Data.Monadic.List [2] although our version not only uses monadic  
> tails but also monadic heads. See [3] for a tutorial.

A small correction: the tail of ListT is not monadic, but "unpacking"  
it (getting either a Nil or a Cons) is.
If just the tail was monadic one couldn't create a list which might be  
empty depending on a monadic result,

For example:

linesFromUser :: ListT IO String
linesFromUser = takeWhile (not . null) . joinM $ repeat getLine

linesFromUser is a list of lines from the user until an empty line,  
not including the empty line.
the first line entered by the user determines if the list is empty or  
not.

cheers,
Yair

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/haskell/attachments/20090716/5ffb7c4d/attachment.html


More information about the Haskell mailing list