Proposal for containers: Add 'lookup' function to Data.Set

Joachim Breitner mail at joachim-breitner.de
Tue Jun 28 08:46:54 UTC 2016


Hi,

given that for naive uses and users, the existence of lookup is more
confusing than helpful, I’m in favor of a name that indicates “this is
advanced foo”, a suitable documentation, and moving it to the very end
of the module documentation, as it is not a function you’d expect for a
set implementation.

The name "Pointer", though, might be a bit too low-level. Maybe
"lookupWithSharing"?

Greetings,
Joachim

Am Dienstag, den 28.06.2016, 06:14 +0100 schrieb Malcolm Wallace:
> Or "lookupSharedPointer", if that is the important part of the
> operational semantics.
> 
>  Regards,
>     Malcolm (iPhone)
> 
> On 27 Jun 2016, at 23:17, David Feuer <david.feuer at gmail.com> wrote:
> 
> Another option might be "find".
> On Jun 27, 2016 5:56 PM, "David Feuer" <david.feuer at gmail.com> wrote:
> > As much as I dislike the names lookupGT, et al, I think that's
> > probably your best bet now that they exist.
> > On Jun 27, 2016 5:52 PM, "Nicolas Godbout" <nicolas.godbout at gmail.c
> > om> wrote:
> > > David Feuer wrote:
> > > > +1 on the function. -1/2 on the name.
> > > 
> > > To be honest, I briefly considered the name `lookupEQ`. The name
> > > would fit nicely with `lookupGT` and company.
> > > 
> > > Nicolas.
> > > 

-- 

Joachim “nomeata” Breitner
  mail at joachim-breitner.dehttps://www.joachim-breitner.de/
  XMPP: nomeata at joachim-breitner.de • OpenPGP-Key: 0xF0FBF51F
  Debian Developer: nomeata at debian.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: This is a digitally signed message part
URL: <http://mail.haskell.org/pipermail/libraries/attachments/20160628/661454a5/attachment.sig>


More information about the Libraries mailing list