I made an operator for the xor-function, it looks like that:
op :: Integer -> Integer -> Maybe Integer
op x y
| x == 0 && y == 0 = Just 0
| x == 0 && y == 1 = Just 1
| x == 1 && y == 0 = Just 1
| x == 1 && y == 1 = Just 0
| otherwise = Nothing
I used 0 and 1 instead of True and False but that shouldn't make a difference for the result. I read it forms a monoid but I don't understand why. Associativity is obvious and doesn't need a proof(I already made the proof by myself), but what is the identity element and why?
Edit: Here's one without numbers:
xor :: Bool -> Bool -> Bool
xor x y | x == True && y == False = True
| x == False && y == True = True
| otherwise = False