shithub: MicroHs

ref: a41e34ea12fb001d5cbcbb8f89c51527d9a48d42
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 fa fb arg =
  case arg of
    Left  a -> fa a
    Right b -> fb b