Set operations in Haskell
Haskell has some neat “set” operations for lists in the Data.List
package:
Prelude> import Data.List
union [1,2,3] [4,5,6] -- returns [1,2,3,4,5,6]
intersect [1,2,3] [1,2,5] -- returns [1,2]
[1,2,3] \ [1,2] -- returns [3]
delete 2 [1,2,2,3] -- returns [1,2,3]
More info can be found on Hackage.