shithub: MicroHs

ref: f5cacb9496b3a9e073d04b3eea27bae3fb37c4dc
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
import Primitives

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