HORIZON HASKELLDocslts/ghc-9.10.xc74966e2026-09-27Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · c74966e · 2026-09-27

Modulerebase-1.21.2Haskell2010

Rebase.Data.Functor.Invariant

  • 6 types
  • 2 classes
  • 7 values
  • Packagerebase-1.21.2
  • Exports15
  • LanguageHaskell2010
  • LicenceMIT
  • SourceInvariant.hs
classclass Invariant (f :: Type -> Type) where
#

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')

Methods

  • invmap :: (a -> b) -> (b -> a) -> f a -> f b
Instances130Invariant, …
newtypenewtype WrappedBifunctor (p :: k -> k1 -> Type) (a :: k) (b :: k1)
#

Make a Functor over the second argument of a Bifunctor.

Constructors

Instances28Generic1, Bifoldable, Bifoldable1, Bifunctor, Bitraversable, Eq2, …
classclass Invariant2 (f :: Type -> Type -> Type) where
#

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')

Methods

  • invmap2 :: (a -> c) -> (c -> a) -> (b -> d) -> (d -> b) -> f a b -> f c d
Instances49Invariant2, …
newtypenewtype WrappedFunctor (f :: k -> Type) (a :: k)
#

Wrap a Functor to be used as a member of Invariant.

Constructors

Instances12Monad, Functor, Applicative, Foldable, Traversable, Alternative, …
newtypenewtype WrappedProfunctor (p :: k -> k1 -> Type) (a :: k) (b :: k1)
#

Wrap a Profunctor to be used as a member of Invariant2.

Constructors

Instances23ProfunctorFunctor, Category, ProfunctorComonad, ProfunctorMonad, Arrow, ArrowChoice, …
newtypenewtype WrappedContravariant (f :: k -> Type) (a :: k)
#

Wrap a Contravariant functor to be used as a member of Invariant.

Instances8Contravariant, Decidable, Divisible, Invariant, Eq, Ord, …
valueinvmapArrow :: Arrow arr => (a -> b) -> (b -> a) -> arr a a -> arr b b
#

An Arrow with the same input and output types can be seen as an Invariant functor.