shithub: MicroHs

ref: ef3d5eb28f6145d1a860901c9abe3fe0f18b777f
dir: /lib/Data/Either.hs/

View raw version
-- Copyright 2023 Lennart Augustsson
-- See LICENSE file for full license.
module Data.Either(module Data.Either) where

data Either a b = Left a | Right b

either :: forall a b r . (a -> r) -> (b -> r) -> Either a b -> r
either f _ (Left  a) = f a
either _ f (Right b) = f b