On 12/19/05, Chris Kuklewicz <[EMAIL PROTECTED]> wrote:
> Okay...that works.  Sweet.
>
> gdc x = ListT $ getDirectoryContents x
>
> get3levels top = runListT $ do
>   b <- gdc top
>   c <- gdc $ top++('/':b)
>   d <- gdc $ top++('/':b)++('/':c)
>   return (b,c,d)

Yeah, that's awesome: just as readable as the comprehension
psuedo-code if not more-so.  I knew some monad wizards would step out
with something nice.

Thanks for spelling out what Andrew was getting at also, it would have
been lost on me.  I haven't yet ventured into using any monads but IO
yet, maybe ListT would be a good place to start.


> I feel bound to point out http://haskell.org/hawiki/ListTDoneRight which
> has more to say about the details of ListT

OK. Thanks to you both Chris and Andrew.

Steve
_______________________________________________
Haskell-Cafe mailing list
Haskell-Cafe@haskell.org
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to