Safe Haskell | Safe |
---|---|
Language | Haskell2010 |
Synopsis
- class Contravariant (t :: * -> *) where
- (>$<) :: (a -> b) -> t b -> t a
- contramap :: (a -> b) -> t b -> t a
- (>$) :: b -> t b -> t a
- ($<) :: t b -> b -> t a
- full :: t () -> t a
- (>&<) :: t b -> (a -> b) -> t a
- (>$$<) :: Contravariant u => (a -> b) -> ((t :. u) := a) -> (t :. u) := b
- (>$$$<) :: (Contravariant u, Contravariant v) => (a -> b) -> ((t :. (u :. v)) := b) -> (t :. (u :. v)) := a
- (>$$$$<) :: (Contravariant u, Contravariant v, Contravariant w) => (a -> b) -> ((t :. (u :. (v :. w))) := a) -> (t :. (u :. (v :. w))) := b
- (>&&<) :: Contravariant u => ((t :. u) := a) -> (a -> b) -> (t :. u) := b
- (>&&&<) :: (Contravariant u, Contravariant v) => ((t :. (u :. v)) := b) -> (a -> b) -> (t :. (u :. v)) := a
- (>&&&&<) :: (Contravariant u, Contravariant v, Contravariant w) => ((t :. (u :. (v :. w))) := a) -> (a -> b) -> (t :. (u :. (v :. w))) := b
Documentation
class Contravariant (t :: * -> *) where Source #
When providing a new instance, you should ensure it satisfies the two laws: * Identity morphism: contramap identity ≡ identity * Interpreted of morphisms: contramap f . contramap g ≡ contramap (g . f)
(>$<) :: (a -> b) -> t b -> t a infixl 4 Source #
Infix version of contramap
contramap :: (a -> b) -> t b -> t a Source #
Prefix version of >$<
(>$) :: b -> t b -> t a infixl 4 Source #
Replace all locations in the output with the same value
($<) :: t b -> b -> t a infixl 4 Source #
Flipped version of >$
Fill the input of evaluation
(>&<) :: t b -> (a -> b) -> t a Source #
Flipped infix version of contramap
(>$$<) :: Contravariant u => (a -> b) -> ((t :. u) := a) -> (t :. u) := b Source #
Infix versions of contramap
with various nesting levels
(>$$$<) :: (Contravariant u, Contravariant v) => (a -> b) -> ((t :. (u :. v)) := b) -> (t :. (u :. v)) := a Source #
(>$$$$<) :: (Contravariant u, Contravariant v, Contravariant w) => (a -> b) -> ((t :. (u :. (v :. w))) := a) -> (t :. (u :. (v :. w))) := b Source #
(>&&<) :: Contravariant u => ((t :. u) := a) -> (a -> b) -> (t :. u) := b Source #
Infix flipped versions of contramap
with various nesting levels
(>&&&<) :: (Contravariant u, Contravariant v) => ((t :. (u :. v)) := b) -> (a -> b) -> (t :. (u :. v)) := a Source #
(>&&&&<) :: (Contravariant u, Contravariant v, Contravariant w) => ((t :. (u :. (v :. w))) := a) -> (a -> b) -> (t :. (u :. (v :. w))) := b Source #