contravariant-1.4: Contravariant functors

Copyright(c) Edward Kmett 2010
LicenseBSD3
Maintainerekmett@gmail.com
Stabilityexperimental
Portabilityportable
Safe HaskellSafe
LanguageHaskell98

Data.Functor.Contravariant.Compose

Description

Composition of contravariant functors.

Synopsis

Documentation

newtype Compose f g a Source

Composition of two contravariant functors

Constructors

Compose 

Fields

Instances

(Contravariant f, Contravariant g) => Functor (Compose f g) Source 

Methods

fmap :: (a -> b) -> Compose f g a -> Compose f g b

(<$) :: a -> Compose f g b -> Compose f g a

newtype ComposeFC f g a Source

Composition of covariant and contravariant functors

Constructors

ComposeFC 

Fields

Instances

(Functor f, Functor g) => Functor (ComposeFC f g) Source 

Methods

fmap :: (a -> b) -> ComposeFC f g a -> ComposeFC f g b

(<$) :: a -> ComposeFC f g b -> ComposeFC f g a

(Functor f, Contravariant g) => Contravariant (ComposeFC f g) Source 

Methods

contramap :: (a -> b) -> ComposeFC f g b -> ComposeFC f g a Source

(>$) :: b -> ComposeFC f g b -> ComposeFC f g a Source

(Applicative f, Decidable g) => Decidable (ComposeFC f g) Source 

Methods

lose :: (a -> Void) -> ComposeFC f g a Source

choose :: (a -> Either b c) -> ComposeFC f g b -> ComposeFC f g c -> ComposeFC f g a Source

(Applicative f, Divisible g) => Divisible (ComposeFC f g) Source 

Methods

divide :: (a -> (b, c)) -> ComposeFC f g b -> ComposeFC f g c -> ComposeFC f g a Source

conquer :: ComposeFC f g a Source

newtype ComposeCF f g a Source

Composition of contravariant and covariant functors

Constructors

ComposeCF 

Fields

Instances

(Functor f, Functor g) => Functor (ComposeCF f g) Source 

Methods

fmap :: (a -> b) -> ComposeCF f g a -> ComposeCF f g b

(<$) :: a -> ComposeCF f g b -> ComposeCF f g a

(Contravariant f, Functor g) => Contravariant (ComposeCF f g) Source 

Methods

contramap :: (a -> b) -> ComposeCF f g b -> ComposeCF f g a Source

(>$) :: b -> ComposeCF f g b -> ComposeCF f g a Source

(Divisible f, Applicative g) => Divisible (ComposeCF f g) Source 

Methods

divide :: (a -> (b, c)) -> ComposeCF f g b -> ComposeCF f g c -> ComposeCF f g a Source

conquer :: ComposeCF f g a Source