comonad-4.2.7.2: Comonads

Copyright | (C) 2008-2011 Edward Kmett
License | BSD-style (see the file LICENSE)
Maintainer | Edward Kmett <ekmett@gmail.com>
Stability | provisional
Portability | portable
Safe Haskell | Safe
Language | Haskell2010

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) Source |
(Foldable f, Foldable g) => Foldable (Coproduct f g) Source |
(Traversable f, Traversable g) => Traversable (Coproduct f g) Source |
(Contravariant f, Contravariant g) => Contravariant (Coproduct f g) Source |
(Comonad f, Comonad g) => Comonad (Coproduct f g) Source |
(Eq (f a), Eq (g a)) => Eq (Coproduct f g a) Source |
(Ord (f a), Ord (g a)) => Ord (Coproduct f g a) Source |
(Read (f a), Read (g a)) => Read (Coproduct f g a) Source |
(Show (f a), Show (g a)) => Show (Coproduct f g a) Source |

left :: f a -> Coproduct f g a Source

right :: g a -> Coproduct f g a Source

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