Learn You a Haskell presents the \\ function.\\ is the list difference function. It acts like a set difference,  basically. For every element in the right-hand list, it removes a  matching element in the left one.Example:ghci> [1..10] \\ [2,5,9]  [1,3,4,6,7,8,10]  Please critique my implementation.setDifference :: (Eq a) => [a] -> [a] -> [a]setDifference xs excludes = filter (not . (`elem` excludes)) xsTest:*Main> setDifference [1,2,3] [2,4,5,6][1,3]
Implementing Haskell's \\ (Set Difference)
haskell;reinventing the wheel