pandora-0.3.1: A box of patterns and paradigms

Safe HaskellSafe
LanguageHaskell2010

Pandora.Pattern.Functor.Divariant

Synopsis
  • class Divariant (v :: * -> * -> *) where
    • (>->) :: v a b -> v c d -> v b c -> v a d
    • dimap :: v a b -> v c d -> v b c -> v a d

Documentation

class Divariant (v :: * -> * -> *) 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

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

dimap :: v a b -> v c d -> v b c -> v a d Source #

Prefix version of >->

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 #