Module

Data.Functor.Coproduct

#Coproduct

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

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

Left injection

#right

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

Right injection

#coproduct

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

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

Change the underlying functors in a coproduct

Modules