pandora-0.5.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:
Exactly 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 infixl 7 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 (Flip Store r) Source # 
Instance details

Defined in Pandora.Paradigm.Inventory.Some.Store

Methods

(<!<) :: (a -> b) -> (b -> a) -> Flip Store r a -> Flip Store r b Source #

invmap :: (a -> b) -> (b -> a) -> Flip Store r a -> Flip Store r b Source #

Invariant (Flip (Lens available) tgt) Source # 
Instance details

Defined in Pandora.Paradigm.Inventory.Some.Optics

Methods

(<!<) :: (a -> b) -> (b -> a) -> Flip (Lens available) tgt a -> Flip (Lens available) tgt b Source #

invmap :: (a -> b) -> (b -> a) -> Flip (Lens available) tgt a -> Flip (Lens available) tgt b Source #

Invariant (Flip State r) Source # 
Instance details

Defined in Pandora.Paradigm.Inventory.Some.State

Methods

(<!<) :: (a -> b) -> (b -> a) -> Flip State r a -> Flip State r b Source #

invmap :: (a -> b) -> (b -> a) -> Flip State r a -> Flip State r 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 #