pandora-0.3.7: A box of patterns and paradigms
Safe HaskellSafe-Inferred
LanguageHaskell2010

Pandora.Pattern.Functor.Divariant

Synopsis
  • class Divariant (v :: * -> * -> *) where
    • (>->) :: (a -> b) -> (c -> d) -> v b c -> v a d
    • dimap :: (a -> b) -> (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

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

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

Prefix version of >->

Instances

Instances details
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 #