pandora-0.1.0: A box of patterns and paradigms

Safe HaskellSafe
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
    • (>$>) :: (b -> a) -> (a -> b) -> 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)

Minimal complete definition

(<$<)

Methods

(<$<) :: (a -> b) -> (b -> a) -> t a -> t b infixr 4 Source #

Infix version of invmap

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

Prefix version of <$<

(>$>) :: (b -> a) -> (a -> b) -> t a -> t b infixl 4 Source #

Flipped version of <$<