| Safe Haskell | Safe-Infered |
|---|
Data.Functor.Invariant
- class Invariant f where
- invmap :: (a -> b) -> (b -> a) -> f a -> f b
- class Invariant2 f where
- invmap2 :: (a -> c) -> (c -> a) -> (b -> d) -> (d -> b) -> f a b -> f c d
Documentation
Any *->* type parametric in the argument permits an instance of
Invariant.
Instances should satisfy the following laws:
invmap id id = id invmap f2 f2' . invmap f1 f1' = invmap (f2 . f1) (f1' . f2')
Instances
| Invariant [] | |
| Invariant IO | |
| Invariant ZipList | Control.Applicative |
| Invariant ReadPrec | |
| Invariant ReadP | |
| Invariant Maybe | |
| Invariant Predicate | from the |
| Invariant Comparison | from the |
| Invariant Equivalence | from the |
| Invariant ((->) a) | |
| Invariant (Either a) | |
| Invariant ((,) a) | |
| Invariant (Const a) | Control.Applicative |
| Monad m => Invariant (WrappedMonad m) | Control.Applicative |
| Invariant (ST s) | |
| Invariant (Op a) | from the |
| Invariant ((,,) a b) | |
| Arrow arr => Invariant (WrappedArrow arr a) | Control.Applicative |
| (Invariant f, Invariant g) => Invariant (Compose f g) | from the |
| (Invariant f, Invariant g) => Invariant (ComposeFC f g) | from the |
| (Invariant f, Invariant g) => Invariant (ComposeCF f g) | from the |
| Invariant ((,,,) a b c) | |
| Invariant ((,,,,) a b c d) |
class Invariant2 f whereSource
Any *->*->* type parametric in both arguments permits an instance of
Invariant2.
Instances should satisfy the following laws:
invmap2 id id id id = id invmap2 f2 f2' g2 g2' . invmap2 f1 f1' g1 g1' = invmap2 (f2 . f1) (f1' . f2') (g2 . g1) (g1' . g2')
Instances
| Invariant2 (->) | |
| Invariant2 Either | |
| Invariant2 (,) | |
| Invariant2 Const | Control.Applicative |
| Invariant2 Op | from the |
| Invariant2 ((,,) a) | |
| Arrow arr => Invariant2 (WrappedArrow arr) | Control.Applicative |
| Invariant2 ((,,,) a b) | |
| Invariant2 ((,,,,) a b c) |