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

Modulelens-5.3.5Haskell2010

Control.Lens.Internal.Context

  • 6 types
  • 4 classes
  • Packagelens-5.3.5
  • Exports10
  • LanguageHaskell2010
  • LicenceBSD-2-Clause
  • SourceContext.hs
classclass IndexedFunctor (w :: Type -> Type -> Type -> Type) where
#

This is a Bob Atkey -style 2-argument indexed functor.

It exists as a superclass for IndexedComonad and expresses the functoriality of an IndexedComonad in its third argument.

Methods

  • ifmap :: (s -> t) -> w a b s -> w a b t
Instances10IndexedFunctor, …
classclass IndexedFunctor w => IndexedComonad (w :: Type -> Type -> Type -> Type) where
#

This is a Bob Atkey -style 2-argument indexed comonad.

It exists as a superclass for IndexedComonad and expresses the functoriality of an IndexedComonad in its third argument.

The notion of indexed monads is covered in more depth in Bob Atkey's "Parameterized Notions of Computation" http://bentnib.org/paramnotions-jfp.pdf and that construction is dualized here.

Methods

  • iextract :: w a a t -> t

    extract from an indexed comonadic value when the indices match.

  • iduplicate :: w a c t -> w a b (w b c t)

    duplicate an indexed comonadic value splitting the index.

  • iextend :: (w b c t -> r) -> w a c t -> w a b r

    extend a indexed comonadic computation splitting the index.

Instances8IndexedComonad, …
classclass IndexedComonad w => IndexedComonadStore (w :: Type -> Type -> Type -> Type) where
#

This is an indexed analogue to ComonadStore for when you are working with an IndexedComonad.

Methods

  • ipos :: w a c t -> a

    This is the generalization of pos to an indexed comonad store.

  • ipeek :: c -> w a c t -> t

    This is the generalization of peek to an indexed comonad store.

  • ipeeks :: (a -> c) -> w a c t -> t

    This is the generalization of peeks to an indexed comonad store.

  • iseek :: b -> w a c t -> w b c t

    This is the generalization of seek to an indexed comonad store.

  • iseeks :: (a -> b) -> w a c t -> w b c t

    This is the generalization of seeks to an indexed comonad store.

  • iexperiment :: Functor f => (b -> f c) -> w b c t -> f t

    This is the generalization of experiment to an indexed comonad store.

  • context :: w a b t -> Context a b t

    We can always forget the rest of the structure of w and obtain a simpler indexed comonad store model called Context.

Instances3IndexedComonadStore
classclass Corepresentable p => Sellable (p :: Type -> Type -> Type) (w :: Type -> Type -> Type -> Type) | w -> p where
#

This is used internally to construct a Bazaar, Context or Pretext from a singleton value.

Methods

  • sell :: p a (w a b b)
Instances9Sellable, …
datadata Context a b t
#

The indexed store can be used to characterize a Control.Lens.Lens.Lens and is used by cloneLens.

Context a b t is isomorphic to newtype Context a b t = Context { runContext :: forall f. Functor f => (a -> f b) -> f t }, and to exists s. (s, Control.Lens.Lens.Lens s t a b).

A Context is like a Control.Lens.Lens.Lens that has already been applied to a some structure.

Constructors

Instances7IndexedComonad, IndexedComonadStore, IndexedFunctor, ComonadStore, Functor, Comonad, …
newtypenewtype Pretext (p :: Type -> Type -> Type) a b t
#

This is a generalized form of Context that can be repeatedly cloned with less impact on its performance, and which permits the use of an arbitrary Conjoined Profunctor

Constructors

Instances7Sellable, ComonadStore, IndexedComonad, IndexedComonadStore, IndexedFunctor, Functor, …
newtypenewtype PretextT (p :: Type -> Type -> Type) (g :: Type -> Type) a b t
#

This is a generalized form of Context that can be repeatedly cloned with less impact on its performance, and which permits the use of an arbitrary Conjoined Profunctor.

The extra phantom Functor is used to let us lie and claim Control.Lens.Getter.Getter-compatibility under limited circumstances. This is used internally to permit a number of combinators to gracefully degrade when applied to a Control.Lens.Fold.Fold or Control.Lens.Getter.Getter.

Constructors

Instances8Sellable, ComonadStore, IndexedComonad, IndexedComonadStore, IndexedFunctor, Functor, …