<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<p>I've taken a look, and it seems like a non-trivial change. For
now I've added a version that simply traverses two times for Seq,
to have API parity with Map/IntMap. If people are happy to accept
pop/popWithDefault (be it with different names) I'll put in the
work to make it do a single traversal for Seq too.<br>
</p>
<div class="moz-cite-prefix">On 12/6/20 5:43 PM, David Feuer wrote:<br>
</div>
<blockquote type="cite"
cite="mid:CAMgWh9s5vHmvSFHukZnPrtcPrpzBTK=2AkM9yzub5yjZNZCvLQ@mail.gmail.com">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<div dir="auto">I suggest you add a version for Data.Sequence
combining lookup with deleteAt. I wanted that for something
fairly recently.</div>
<br>
<div class="gmail_quote">
<div dir="ltr" class="gmail_attr">On Sun, Dec 6, 2020, 11:41 AM
Martijn Bastiaan via Libraries <<a
href="mailto:libraries@haskell.org" moz-do-not-send="true">libraries@haskell.org</a>>
wrote:<br>
</div>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">Yeah,
Python's `pop` made me call it `pop`. I had hoped to find
other <br>
examples, but Java, Rust, and Ruby don't seem to offer
`pop`-like <br>
functions for their (hash)maps.<br>
<br>
On 12/6/20 5:29 PM, Tom Ellis wrote:<br>
> On Sun, Dec 06, 2020 at 11:25:33AM -0500, David Feuer
wrote:<br>
>> The name pop makes me think of a stack. Is this use
of the word common?<br>
> Python uses that name, which is why I'm familiar with it:<br>
><br>
>>>> d = {'a': 1, 'b': 2}<br>
>>>> d.pop('b')<br>
> 2<br>
>>>> d<br>
> {'a': 1}<br>
> _______________________________________________<br>
> Libraries mailing list<br>
> <a href="mailto:Libraries@haskell.org" target="_blank"
rel="noreferrer" moz-do-not-send="true">Libraries@haskell.org</a><br>
> <a
href="http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries"
rel="noreferrer noreferrer" target="_blank"
moz-do-not-send="true">http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries</a><br>
_______________________________________________<br>
Libraries mailing list<br>
<a href="mailto:Libraries@haskell.org" target="_blank"
rel="noreferrer" moz-do-not-send="true">Libraries@haskell.org</a><br>
<a
href="http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries"
rel="noreferrer noreferrer" target="_blank"
moz-do-not-send="true">http://mail.haskell.org/cgi-bin/mailman/listinfo/libraries</a><br>
</blockquote>
</div>
</blockquote>
</body>
</html>