Proposal: Move some functions from Control.Monad to Data.List

Specifically: filterM, mapAndUnzipM (unless we can sensibly and efficiently generalize it from lists to arbitrary Functors or at least Traversables, which looks like it might be possible), zipWithM, zipWithM_, replicateM, replicateM_ These functions all have to do with monads, yes, but they're about using monads with lists. Some other types are perfectly capable of doing similar things with monads. David the Feuer

I'd be a lot more keen on this proposal if it was suggesting just to *also*
export them from Data.List, rather than move them. A lot of code imports
them from their existing location, and this doesn't provide a clean upgrade
path for users.
-Edward
On Mon, Dec 29, 2014 at 8:09 PM, David Feuer
Specifically:
filterM, mapAndUnzipM (unless we can sensibly and efficiently generalize it from lists to arbitrary Functors or at least Traversables, which looks like it might be possible), zipWithM, zipWithM_, replicateM, replicateM_
These functions all have to do with monads, yes, but they're about using monads with lists. Some other types are perfectly capable of doing similar things with monads.
David the Feuer _______________________________________________ Libraries mailing list Libraries@haskell.org http://www.haskell.org/mailman/listinfo/libraries

Yes, that would be necessary. Perhaps we could add a new module,
Control.Monad.NoLists, to avoid importing them from Control.Monad, but
I'm not optimistic anyone else will think that wise.
On Mon, Dec 29, 2014 at 11:45 PM, Edward Kmett
I'd be a lot more keen on this proposal if it was suggesting just to also export them from Data.List, rather than move them. A lot of code imports them from their existing location, and this doesn't provide a clean upgrade path for users.
-Edward
On Mon, Dec 29, 2014 at 8:09 PM, David Feuer
wrote: Specifically:
filterM, mapAndUnzipM (unless we can sensibly and efficiently generalize it from lists to arbitrary Functors or at least Traversables, which looks like it might be possible), zipWithM, zipWithM_, replicateM, replicateM_
These functions all have to do with monads, yes, but they're about using monads with lists. Some other types are perfectly capable of doing similar things with monads.
David the Feuer _______________________________________________ Libraries mailing list Libraries@haskell.org http://www.haskell.org/mailman/listinfo/libraries
participants (2)
-
David Feuer
-
Edward Kmett