<div dir="ltr">Fair enough.<div><br></div><div>-Edward</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, May 19, 2016 at 8:30 PM, David Feuer <span dir="ltr"><<a href="mailto:david.feuer@gmail.com" target="_blank">david.feuer@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Wren Romano and I have decided to maintain consistency in the argument<br>
order, even though this is more annoying for people using lens. Thus<br>
<span class=""><br>
alterF :: (Functor f, Ord k) => (Maybe a -> f (Maybe a)) -> k -> Map k<br>
a -> f (Map k a)<br>
<br>
</span>and `<a href="http://Control.Lens.At.at" rel="noreferrer" target="_blank">Control.Lens.At.at</a>` for maps can be implemented as<br>
<br>
at = flip Data.Map.Lazy.alterF<br>
<br>
Note that Data.Map.Strict will also offer a version of alterF that<br>
forces any values it installs in the map.<br>
<span class="im HOEnZb"><br>
<br>
On Sat, May 7, 2016 at 4:45 PM, David Feuer <<a href="mailto:david.feuer@gmail.com">david.feuer@gmail.com</a>> wrote:<br>
</span><div class="HOEnZb"><div class="h5">> I managed to find an implementation of <a href="http://Control.Lens.At.at" rel="noreferrer" target="_blank">Control.Lens.At.at</a> for Data.Map<br>
> that's fast enough to be useful. The function will be named alterF to match<br>
> the name of Data.Map.alter. The remaining question is what order the<br>
> arguments should go in. I had thought to follow those of alter for<br>
> consistency, giving<br>
><br>
> alterF :: (Functor f, Ord k) => (Maybe a -> f (Maybe a)) -> k -> Map k a -><br>
> f (Map k a)<br>
><br>
> Edward Kmett thinks the ergonomics of that order are terrible, and prefers<br>
> to follow lens at, giving<br>
><br>
> alterF :: (Functor f, Ord k) => k -> (Maybe a -> f (Maybe a)) -> Map k a -><br>
> f (Map k a)<br>
><br>
> How do other people feel about this?<br>
><br>
> David Feuer<br>
</div></div></blockquote></div><br></div>