pandora-0.1.6: A box of patterns and paradigms

Safe HaskellSafe
LanguageHaskell2010

Pandora.Pattern.Functor.Invariant

Synopsis
  • class Invariant (t :: * -> *) where
    • invmap :: (a -> b) -> (b -> a) -> t a -> t b

Documentation

class Invariant (t :: * -> *) where Source #

When providing a new instance, you should ensure it satisfies the two laws:
Identity morphisms: invmap identity identity = identity
Composition of morphisms: invmap g j . invmap f h = invmap (g . f) (h . j)

Methods

invmap :: (a -> b) -> (b -> a) -> t a -> t b Source #

Instances
Invariant Endo Source # 
Instance details

Defined in Pandora.Paradigm.Basis.Endo

Methods

invmap :: (a -> b) -> (b -> a) -> Endo a -> Endo b Source #

Invariant (Constant a :: Type -> Type) Source # 
Instance details

Defined in Pandora.Paradigm.Basis.Constant

Methods

invmap :: (a0 -> b) -> (b -> a0) -> Constant a a0 -> Constant a b Source #