partitionM package:ghc

Monadic version of partition
Partitions the Messages and returns a tuple which first element are the warnings, and the second the errors.