Wednesday, March 05, 2008

Xor

While I'm at it, let's continue the series of logical Maybe operators with xor:
infixr 2 ^^^

(^^^) :: Maybe a -> Maybe a -> Maybe a
Nothing ^^^ r@(Just _) = r
l@(Just _) ^^^ Nothing = l
_ ^^^ _ = Nothing

1 comment:

Paul Steckler said...

Confirming once again that the
use of Haskell makes you exclusive.

-- Paul