Haskell: type inference and function composition
- by Pillsy
This question was inspired by this answer to another question, indicating that you can remove every occurrence of an element from a list using a function defined as:
removeall = filter . (/=)
Working it out with pencil and paper from the types of filter, (/=) and (.), the function has a type of
removeall :: (Eq a) => a -> [a] -> [a]
…