lens-core-0.1.0.3: Lenses, Folds and Traversals

Copyright(C) 2012-2016 Edward Kmett
LicenseBSD-style (see the file LICENSE)
MaintainerEdward Kmett <ekmett@gmail.com>
Stabilityexperimental
Portabilitynon-portable
Safe HaskellNone
LanguageHaskell2010

Control.Lens.Internal.Context

Description

 
Synopsis

Documentation

class IndexedFunctor w where Source #

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 Source #

Instances
IndexedFunctor Context Source # 
Instance details

Defined in Control.Lens.Internal.Context

Methods

ifmap :: (s -> t) -> Context a b s -> Context a b t Source #

IndexedFunctor Mafic Source # 
Instance details

Defined in Control.Lens.Internal.Magma

Methods

ifmap :: (s -> t) -> Mafic a b s -> Mafic a b t Source #

IndexedFunctor (Pretext p) Source # 
Instance details

Defined in Control.Lens.Internal.Context

Methods

ifmap :: (s -> t) -> Pretext p a b s -> Pretext p a b t Source #

IndexedFunctor (Bazaar1 p) Source # 
Instance details

Defined in Control.Lens.Internal.Bazaar

Methods

ifmap :: (s -> t) -> Bazaar1 p a b s -> Bazaar1 p a b t Source #

IndexedFunctor (Bazaar p) Source # 
Instance details

Defined in Control.Lens.Internal.Bazaar

Methods

ifmap :: (s -> t) -> Bazaar p a b s -> Bazaar p a b t Source #

IndexedFunctor (Molten i) Source # 
Instance details

Defined in Control.Lens.Internal.Magma

Methods

ifmap :: (s -> t) -> Molten i a b s -> Molten i a b t Source #

IndexedFunctor (PretextT p g) Source # 
Instance details

Defined in Control.Lens.Internal.Context

Methods

ifmap :: (s -> t) -> PretextT p g a b s -> PretextT p g a b t Source #

class IndexedFunctor w => IndexedComonad w where Source #

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.

Minimal complete definition

iextract, (iduplicate | iextend)

Methods

iextract :: w a a t -> t Source #

extract from an indexed comonadic value when the indices match.

iduplicate :: w a c t -> w a b (w b c t) Source #

duplicate an indexed comonadic value splitting the index.

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

extend a indexed comonadic computation splitting the index.

Instances
IndexedComonad Context Source # 
Instance details

Defined in Control.Lens.Internal.Context

Methods

iextract :: Context a a t -> t Source #

iduplicate :: Context a c t -> Context a b (Context b c t) Source #

iextend :: (Context b c t -> r) -> Context a c t -> Context a b r Source #

IndexedComonad (Molten i) Source # 
Instance details

Defined in Control.Lens.Internal.Magma

Methods

iextract :: Molten i a a t -> t Source #

iduplicate :: Molten i a c t -> Molten i a b (Molten i b c t) Source #

iextend :: (Molten i b c t -> r) -> Molten i a c t -> Molten i a b r Source #

data Context a b t Source #

The indexed store can be used to characterize a 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, Lens s t a b).

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

Constructors

Context (b -> t) a 
Instances
IndexedComonad Context Source # 
Instance details

Defined in Control.Lens.Internal.Context

Methods

iextract :: Context a a t -> t Source #

iduplicate :: Context a c t -> Context a b (Context b c t) Source #

iextend :: (Context b c t -> r) -> Context a c t -> Context a b r Source #

IndexedFunctor Context Source # 
Instance details

Defined in Control.Lens.Internal.Context

Methods

ifmap :: (s -> t) -> Context a b s -> Context a b t Source #

Functor (Context a b) Source # 
Instance details

Defined in Control.Lens.Internal.Context

Methods

fmap :: (a0 -> b0) -> Context a b a0 -> Context a b b0 #

(<$) :: a0 -> Context a b b0 -> Context a b a0 #

type Context' a = Context a a Source #

type Context' a s = Context a a s

newtype Pretext p a b t Source #

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

Pretext 

Fields

Instances
IndexedFunctor (Pretext p) Source # 
Instance details

Defined in Control.Lens.Internal.Context

Methods

ifmap :: (s -> t) -> Pretext p a b s -> Pretext p a b t Source #

Functor (Pretext p a b) Source # 
Instance details

Defined in Control.Lens.Internal.Context

Methods

fmap :: (a0 -> b0) -> Pretext p a b a0 -> Pretext p a b b0 #

(<$) :: a0 -> Pretext p a b b0 -> Pretext p a b a0 #

type Pretext' p a = Pretext p a a Source #

type Pretext' p a s = Pretext p a a s

newtype PretextT p (g :: * -> *) a b t Source #

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 Getter-compatibility under limited circumstances. This is used internally to permit a number of combinators to gracefully degrade when applied to a Fold or Getter.

Constructors

PretextT 

Fields

Instances
IndexedFunctor (PretextT p g) Source # 
Instance details

Defined in Control.Lens.Internal.Context

Methods

ifmap :: (s -> t) -> PretextT p g a b s -> PretextT p g a b t Source #

Functor (PretextT p g a b) Source # 
Instance details

Defined in Control.Lens.Internal.Context

Methods

fmap :: (a0 -> b0) -> PretextT p g a b a0 -> PretextT p g a b b0 #

(<$) :: a0 -> PretextT p g a b b0 -> PretextT p g a b a0 #

type PretextT' p g a = PretextT p g a a Source #

type PretextT' p g a s = PretextT p g a a s