Module

Data.Functor.Coproduct

Package
purescript-functors
Repository
purescript/purescript-functors

#Coproduct Source

newtype Coproduct f g a

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

Constructors

Instances

#left Source

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

Left injection

#right Source

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

Right injection

#coproduct Source

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

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

#bihoistCoproduct Source

bihoistCoproduct :: forall i h g f. (f ~> h) -> (g ~> i) -> (Coproduct f g) ~> (Coproduct h i)

Change the underlying functors in a coproduct