<div>Hi Emily,<br></div><div><br></div><div>As David suggested, removal of `mapM` will be problematic for boxed `Vector`: <a href="https://github.com/haskell/vector/blob/a15a52155f281ca6753ecef1247f84a0579e3123/Data/Vector.hs#L468-L478">https://github.com/haskell/vector/blob/a15a52155f281ca6753ecef1247f84a0579e3123/Data/Vector.hs#L468-L478</a><br></div><div>The reason behind that fact is that streams in `vector` are monadic, so `traverse` implementation has to go through a list, while `mapM` can be implemented in a more efficient manner.<br></div><div class="protonmail_signature_block protonmail_signature_block-empty"><div class="protonmail_signature_block-user protonmail_signature_block-empty"><br></div><div class="protonmail_signature_block-proton protonmail_signature_block-empty"><br></div></div><div><br></div><div>My personal opinion on this is that such slimming of Traversable is counterproductive, the only thing we incur is a bunch of broken libraries and redundant work on maintainers part.<br></div><div>Is there anything that can be won from a user's perspective from such a change? A potential performance or usability benefit that I am missing?<br></div><div><br></div><div>Sincerely,<br></div><div>Alexey.<br></div><div><br></div><div>‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐<br></div><div> On Saturday, November 7, 2020 11:03 PM, David Feuer <david.feuer@gmail.com> wrote:<br></div><div> <br></div><blockquote class="protonmail_quote" type="cite"><div dir="ltr">I'm generally in favor of removing `sequence`, and probably also `sequenceA`. Can you demonstrate that there can be no instance for which `mapM` is much more efficient than `traverse`? Consider especially types based on monadic streams.<br></div><div><br></div><div class="gmail_quote"><div dir="ltr">On Sat, Nov 7, 2020 at 2:56 PM Emily Pillmore <<a href="mailto:emilypi@cohomolo.gy">emilypi@cohomolo.gy</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><div><div><div style="display:none;border:0px;width:0px;height:0px;overflow:hidden"><img alt width="1" height="0" style="display: none; border: 0px; width: 0px; height: 0px; overflow: hidden;"><br></div><div><div>Hi All,<br></div><div><br></div><div><div>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: <br></div><div><br></div><div>```haskell<br></div></div><div>mapM :: Traversable t ⇒ Monad m ⇒ <span>(a -> m b) -> t a -> m (t b)</span><br></div><div><span>mapM = traverse</span><br></div><div><br></div><div>sequence :: <span><span> </span>Traversable t ⇒ Monad m=> t (m a) -> m (t a)</span><br></div><div><span>sequence = sequenceA</span><br></div><div>```<br></div><div><br></div><div>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? <br></div><div><br></div><div>Cheers,<br></div><div>Emily<br></div><div><br></div></div><div><br></div><div><br></div></div></div></div><div>_______________________________________________<br></div><div> Libraries mailing list<br></div><div> <a href="mailto:Libraries@haskell.org" target="_blank">Libraries@haskell.org</a><br></div><div> <a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries" rel="noreferrer" target="_blank">http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries</a><br></div></blockquote></div></blockquote><div><br></div>