
10 Jun
2020
10 Jun
'20
2:42 p.m.
hi, assigment: make your own element function with the any function. --elem with any myElemAny :: Eq a => a -> [a] -> Bool myElemAny a = any (== a) --elem with any myElemAny' :: Eq a => a -> [a] -> Bool myElemAny' a [x]= any (== a) [x] myElemAny' compiles but throws an error because it has a non-exhaustive pattern. Could somebody tell me why the list gives the function grieveness? thanks,