I am trying to write a function defined by two lists, it returns a logical answer if two lists have the same elements, even if they do not appear in the same order. I have something like this:
function :: [a] -> [a] -> Bool
function (x:xs) y = elem x y && function xs y
The problem is that there is no template when xs is empty, and I don't know how to handle this. Any other way to resolve this would be really welcome; I'm brand new to Haskell.
Thanks everyone!
source
share