comonad-transformers-3.1: Comonad transformers

Portabilityportable
Stabilityprovisional
MaintainerEdward Kmett <ekmett@gmail.com>
Safe HaskellTrustworthy

Data.Functor.Coproduct

Description

 

Documentation

newtype Coproduct f g a Source

Constructors

Coproduct 

Fields

getCoproduct :: Either (f a) (g a)
 

Instances

(Functor f, Functor g) => Functor (Coproduct f g) 
(Foldable f, Foldable g) => Foldable (Coproduct f g) 
(Traversable f, Traversable g) => Traversable (Coproduct f g) 
(Comonad f, Comonad g) => Comonad (Coproduct f g) 
(Contravariant f, Contravariant g) => Contravariant (Coproduct f g) 
(Traversable1 f, Traversable1 g) => Traversable1 (Coproduct f g) 
(Foldable1 f, Foldable1 g) => Foldable1 (Coproduct f g) 
(Extend f, Extend g) => Extend (Coproduct f g) 
(Eq (f a), Eq (g a)) => Eq (Coproduct f g a) 
(Ord (f a), Ord (g a)) => Ord (Coproduct f g a) 
(Read (f a), Read (g a)) => Read (Coproduct f g a) 
(Show (f a), Show (g a)) => Show (Coproduct f g a) 

left :: f a -> Coproduct f g aSource

right :: g a -> Coproduct f g aSource

coproduct :: (f a -> b) -> (g a -> b) -> Coproduct f g a -> bSource