
19 Dec
2005
19 Dec
'05
6:13 p.m.
On 12/19/05, Chris Kuklewicz
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