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




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

Left injection


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

Right injection


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 :: forall f g h i. (f ~> h) -> (g ~> i) -> (Coproduct f g) ~> (Coproduct h i)

Change the underlying functors in a coproduct