Re: [Haskell-cafe] comprehension generators from IO [a]'s ?

2005-12-19 Thread Steve Harris
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 read

[Haskell-cafe] comprehension generators from IO [a]'s ?

2005-12-19 Thread Steve Harris
[reposted from haskell mailing list where I got no bites :) ] Folks, I'm new to using monads, and I'd like some help improving a function definition that I wrote and which works, but for which I think there should be a clearer way to write it. What I'm after is something like: -- (psuedo-code)