1 {-# OPTIONS -fno-implicit-prelude #-}
2 -----------------------------------------------------------------------------
4 -- Module : Data.Either
5 -- Copyright : (c) The University of Glasgow 2001
6 -- License : BSD-style (see the file libraries/base/LICENSE)
8 -- Maintainer : libraries@haskell.org
9 -- Stability : experimental
10 -- Portability : portable
12 -- The Either type, and associated operations.
14 -----------------------------------------------------------------------------
18 either -- :: (a -> c) -> (b -> c) -> Either a b -> c
21 #ifdef __GLASGOW_HASKELL__
25 data Either a b = Left a | Right b deriving (Eq, Ord )
27 either :: (a -> c) -> (b -> c) -> Either a b -> c
28 either f _ (Left x) = f x
29 either _ g (Right y) = g y