Search code examples
haskellxorinfix-notation

How do I properly use '/=' haskell infix operator for xor?


I'm learning haskell and I'm having an issue getting a line of code to work. The error says it is specifically to do with my "/=" operator. Could anyone help me properly use it?

Thank you.

e = filter (\(x, y, _) -> (x `elem` ed) `(/=)` (y `elem` ve)) es

Solution

  • Simply write /= as a normal infix operator:

    e = filter (\(x, y, _) -> (x `elem` ed) /= (y `elem` ve)) es