Module

Data.Functor.Coproduct

Package
purescript-functor-coproducts
Repository
purescript/purescript-functor-coproducts

#CoproductSource

newtype Coproduct f g a

Coproduct f g is the coproduct of two functors f and g

Constructors

Instances

#unCoproductSource

unCoproduct :: forall f g a. Coproduct f g a -> Either (f a) (g a)

Unwrap a coproduct

#leftSource

left :: forall f g a. f a -> Coproduct f g a

Left injection

#rightSource

right :: forall f g a. g a -> Coproduct f g a

Right injection

#coproductSource

coproduct :: forall f g a b. (f a -> b) -> (g a -> b) -> Coproduct f g a -> b

Eliminate a coproduct by providing eliminators for the left and right components