data Either a b = Left a | Right b deriving (Eq, Ord, Show, Read) either :: (a -> c) -> (b -> c) -> Either a b -> c either f g (Left a) = f a either f g (Right b) = g b