pandora-0.2.8: 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
Interpreted 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.Primary.Functor.Endo

Methods

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

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

Defined in Pandora.Paradigm.Primary.Functor.Constant

Methods

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