pandora-0.2.2: A box of patterns and paradigms

Safe HaskellSafe
LanguageHaskell2010

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
    • ($) :: t a b -> t a b

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
* Interpreted: 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 >->

($) :: t a b -> t a b infixr 0 Source #

Instances
Divariant ((->) :: Type -> Type -> Type) Source # 
Instance details

Defined 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 #

($) :: (a -> b) -> a -> b Source #