@melpomene, yes, that did not occur to me (I just have files and dirs in the locations I'm looking at). It's fine though I'm more curious for the general case, not necessarily for System.Directory functions. @Dave, I'm not the only one to wonder then :). I can't believe google search didn't return this when searching on partitionM. It does seem there is not something readily available in the library...
–
huynhjlMar 5 '13 at 6:59

1

try searching for "partitionM", with quotes.
–
Will NessMar 5 '13 at 8:59

Thank you. Didn't know about Hayoo I'm marking this as accepted. I may change my answer if someone manages to lift partition (as opposed to writing a new partitionM function) or explain why it's not possible.
–
huynhjlMar 5 '13 at 9:21

@huynhjl It is possible but it is too specialized and will essentially require you to compose a lifting function of the following type signature: ((a -> Bool) -> [a] -> ([a], [a])) -> ((a -> m Bool) -> [a] -> m ([a], [a])), which won't be easy. As such this function will only be applicable to partition. Because of all this it's much more sensible to just implement the partitionM.
–
Nikita VolkovMar 5 '13 at 9:52

Why would it be only applicable to partition and not anything that returns ([a], [a]), such as span, splitAt, break?
–
huynhjlMar 5 '13 at 15:48

@huynhjl splitAt has a different signature. Concerning span and break you're correct, this lifting function will work for them too, but that's it, there are no more functions with that signature.
–
Nikita VolkovMar 5 '13 at 15:58