[Haskell-cafe] Data.Set.member vs Data.List.elem

Ryan Dickie goalieca at gmail.com
Mon Nov 12 18:28:51 EST 2007


Perhaps this has something to due with uniqueness. A list can have many
duplicate elements while a set is supposed to be unique.

On Nov 12, 2007 2:48 PM, Neil Mitchell <ndmitchell at gmail.com> wrote:

> Hi,
>
> Is there a good reason that Data.Set uses the name "member" while
> Data.List (or the Prelude) uses the name "elem", for what to me seem
> identical concepts. I realise that in Set's the traditional test is
> for "membership", but it seems awfully arbitrary that one jumped one
> way and one jumped the other. I've just written an entire module's
> worth of Haskell with Set.elem, as that "felt" right, now I'm going
> back and fixing it.
>
> Thanks
>
> Neil
> _______________________________________________
> Haskell-Cafe mailing list
> Haskell-Cafe at haskell.org
> http://www.haskell.org/mailman/listinfo/haskell-cafe
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.haskell.org/pipermail/haskell-cafe/attachments/20071112/20c928d0/attachment.htm


More information about the Haskell-Cafe mailing list