[Haskell-beginners] Empty list
Norbert Melzer
timmelzer at gmail.com
Wed Mar 25 14:00:02 UTC 2015
You are correct, a list is not a set. A list is a list of things, that can
be there multiple times. A set is a set of things, where nothing can be
twice. So take a look at Data.Set
Am 25.03.2015 14:55 schrieb "Shishir Srivastava" <
shishir.srivastava at gmail.com>:
> Hi,
>
> Can someone please explain why this results in error -
>
> [] `elem` [1,2,3]
>
> Shouldn't the empty set by definition be the element of all sets including
> a non-empty set ?
>
> I am assuming 'Lists' are different from 'Sets' in Haskell, if yes, is
> there a separate module for dealing/working with sets ?
>
> Thanks,
> Shishir Srivastava
>
>
> _______________________________________________
> Beginners mailing list
> Beginners at haskell.org
> http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/beginners/attachments/20150325/6de1bf19/attachment.html>
More information about the Beginners
mailing list