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

Pandora.Pattern.Functor.Invariant

Synopsis
  • class Invariant (t :: * -> *) where
    • (>-<) :: (a -> b) -> (b -> a) -> t a -> t b
    • 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)

Minimal complete definition

(>-<)

Methods

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

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

Prefix version of >-<

Instances

Instances details
Invariant Endo Source # 
Instance details

Defined in Pandora.Paradigm.Primary.Functor.Endo

Methods

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

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

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

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