Module

Data.Functor.Coproduct

Package
functors
Repository
purescript/purescript-functors

#Coproduct Source

newtype Coproduct :: forall k. (k -> Type) -> (k -> Type) -> k -> Typenewtype Coproduct f g a

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

Constructors

Instances

#left Source

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

Left injection

#right Source

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

Right injection

#coproduct Source

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

#bihoistCoproduct Source

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

Change the underlying functors in a coproduct