Original-Via: uk.ac.nsf; Sat, 16 Nov 91 09:47:52 GMT
The operator which was called `in` in version 1.0 seems to have
vanished without trace since `in` became a reservedid. Can I suggest
it be restored to PreludeList, possibly with the name `contains`:
contains :: (Eq a) => [a] -> a -> Bool
[] `contains` x = False
(y:ys) `contains` x | x==y = True
| otherwise = ys `contains` x
Isn't this elem, in PreludeList, defined with arguments in the reverse
order?
elem, notElem :: (Eq a) => a -> [a] -> Bool
elem = any . (==)
notElem = all . (/=)
--brian