<p dir="ltr">Shishir, you need to distinguish between membership (1 is an element of [1,2,3], [] is not) and subsets (both [1] and [] are subsets of [1,2,3]). elem checks the first property, intersection checks the second.</p>
<br><div class="gmail_quote">On Wed, 25 Mar 2015 10:03 Brandon Allbery <<a href="mailto:allbery.b@gmail.com">allbery.b@gmail.com</a>> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Wed, Mar 25, 2015 at 10:00 AM, Norbert Melzer <span dir="ltr"><<a href="mailto:timmelzer@gmail.com" target="_blank">timmelzer@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><p dir="ltr">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</p>
<div class="gmail_quote"></div></blockquote><div><br></div></div></div></div><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div>Note that this won't actually solve the original problem; Haskell is an implementation of a strongly typed lambda calculus, not of number theory, and Haskell collections cannot (easily) contain elements of different types --- so the empty set is not an element of a set, and the empty list is not an element of a list.</div><div><br></div></div></div></div><div dir="ltr"><div class="gmail_extra">-- <br><div><div dir="ltr"><div>brandon s allbery kf8nh                               sine nomine associates</div><div><a href="mailto:allbery.b@gmail.com" target="_blank">allbery.b@gmail.com</a>                                  <a href="mailto:ballbery@sinenomine.net" target="_blank">ballbery@sinenomine.net</a></div><div>unix, openafs, kerberos, infrastructure, xmonad        <a href="http://sinenomine.net" target="_blank">http://sinenomine.net</a></div></div></div>
</div></div>
______________________________<u></u>_________________<br>
Beginners mailing list<br>
<a href="mailto:Beginners@haskell.org" target="_blank">Beginners@haskell.org</a><br>
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners" target="_blank">http://mail.haskell.org/cgi-<u></u>bin/mailman/listinfo/beginners</a><br>
</blockquote></div>