pandora-0.2.0: A box of patterns and paradigms

Pandora.Pattern.Functor.Divariant

Synopsis
• class (forall a. Covariant (t a)) => Divariant (t :: * -> * -> *) where
• (>->) :: (a -> b) -> (c -> d) -> t b c -> t a d
• dimap :: (a -> b) -> (c -> d) -> t b c -> t a d

# Documentation

class (forall a. Covariant (t a)) => Divariant (t :: * -> * -> *) where Source #

When providing a new instance, you should ensure it satisfies the two laws:
* Identity: dimap identity identity ≡ identity
* Composition: dimap (f . g) (h . i) ≡ dimap g h . dimap f i

Minimal complete definition

(>->)

Methods

(>->) :: (a -> b) -> (c -> d) -> t b c -> t a d infixl 4 Source #

Infix version of comap

dimap :: (a -> b) -> (c -> d) -> t b c -> t a d Source #

Prefix version of >->

Instances
 Divariant ((->) :: Type -> Type -> Type) Source # Instance detailsDefined in Pandora.Pattern.Functor.Divariant Methods(>->) :: (a -> b) -> (c -> d) -> (b -> c) -> a -> d Source #dimap :: (a -> b) -> (c -> d) -> (b -> c) -> a -> d Source #