basic haskell: Comparing a set of Ints and a set of set of ints -


is there easy way in can check if 2 lists contain common elements.

ie

set1 = [1,2,3,4] set2 = [[1,5,7],[1,2,3,8]] 

would there way potentially isolate elements in set1 not in of sets in set2? best way add x-amount of sets in set2 have 1 big set (using concat) compare set1 or waste of time?

much appreciated advice.

import data.set set foldl (\x y -> set.difference  x (set.fromlist y)) (set.fromlist set1) set2 

gives following output:

fromlist [4] 

and give members of set1 not in of sets within set2 - seems question.


Comments

Popular posts from this blog

java.util.scanner - How to read and add only numbers to array from a text file -

rewrite - Trouble with Wordpress multiple custom querystrings -