Proposal: Move `mapM` and `sequence` out of Traversable

Emily Pillmore emilypi at
Sat Nov 7 19:55:58 UTC 2020

Hi All,

I have a proposal for the `base` library:  I would like to move `mapM` and `sequence` out of the class definition for `Traversable`, redefining them as toplevel aliases:

mapM :: Traversable t ⇒ Monad m ⇒ (a -> m b) -> t a -> m (t b)

mapM = traverse

sequence :: Traversable t ⇒ Monad m=> t (m a) -> m (t a)

sequence = sequenceA


This slims `Traversable` by 50%. This would be a very small breaking change, which is completely tractable, but a great improvement for the ecosystem imo. Thoughts? What timeline should we shoot for with a change like this?


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the Libraries mailing list