Copyright | (C) 2012-2016 Edward Kmett |
---|---|
License | BSD-style (see the file LICENSE) |
Maintainer | Edward Kmett <ekmett@gmail.com> |
Stability | experimental |
Portability | non-portable |
Safe Haskell | Safe |
Language | Haskell98 |
- class IndexedFunctor w where
- class IndexedFunctor w => IndexedComonad w where
- class IndexedComonad w => IndexedComonadStore w where
- class Corepresentable p => Sellable p w | w -> p where
- data Context a b t = Context (b -> t) a
- type Context' a = Context a a
- newtype Pretext p a b t = Pretext {
- runPretext :: forall f. Functor f => p a (f b) -> f t
- type Pretext' p a = Pretext p a a
- newtype PretextT p g a b t = PretextT {
- runPretextT :: forall f. Functor f => p a (f b) -> f t
- type PretextT' p g a = PretextT p g a a
Documentation
class IndexedFunctor w 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.
IndexedFunctor Context # | |
IndexedFunctor Mafic # | |
IndexedFunctor (Pretext p) # | |
IndexedFunctor (Bazaar1 p) # | |
IndexedFunctor (Bazaar p) # | |
IndexedFunctor (Molten i) # | |
IndexedFunctor (PretextT p g) # | |
IndexedFunctor (BazaarT1 p g) # | |
IndexedFunctor (BazaarT p g) # | |
IndexedFunctor (TakingWhile p f) # | |
class IndexedFunctor w => IndexedComonad w 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.
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.
IndexedComonad Context # | |
Conjoined p => IndexedComonad (Pretext p) # | |
Conjoined p => IndexedComonad (Bazaar1 p) # | |
Conjoined p => IndexedComonad (Bazaar p) # | |
IndexedComonad (Molten i) # | |
Conjoined p => IndexedComonad (PretextT p g) # | |
Conjoined p => IndexedComonad (BazaarT1 p g) # | |
Conjoined p => IndexedComonad (BazaarT p g) # | |
class IndexedComonad w => IndexedComonadStore w where #
This is an indexed analogue to ComonadStore
for when you are working with an
IndexedComonad
.
This is the generalization of pos
to an indexed comonad store.
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
.
IndexedComonadStore Context # | |
Conjoined p => IndexedComonadStore (Pretext p) # | |
Conjoined p => IndexedComonadStore (PretextT p g) # | |
class Corepresentable p => Sellable p w | w -> p where #
Sellable (->) Context # | |
Sellable (->) Mafic # | |
Corepresentable p => Sellable p (Pretext p) # | |
Corepresentable p => Sellable p (Bazaar1 p) # | |
Corepresentable p => Sellable p (Bazaar p) # | |
Corepresentable p => Sellable p (PretextT p g) # | |
Corepresentable p => Sellable p (BazaarT1 p g) # | |
Corepresentable p => Sellable p (BazaarT p g) # | |
Sellable (Indexed i) (Molten i) # | |
The indexed store can be used to characterize a Lens
and is used by cloneLens
.
is isomorphic to
Context
a b tnewtype
,
and to Context
a b t = Context
{ runContext :: forall f. Functor
f => (a -> f b) -> f t }exists s. (s,
.Lens
s t a b)
A Context
is like a Lens
that has already been applied to a some structure.
Context (b -> t) a |
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
Pretext | |
|
Corepresentable p => Sellable p (Pretext p) # | |
((~) * a b, Conjoined p) => ComonadStore a (Pretext p a b) # | |
Conjoined p => IndexedComonadStore (Pretext p) # | |
Conjoined p => IndexedComonad (Pretext p) # | |
IndexedFunctor (Pretext p) # | |
Functor (Pretext p a b) # | |
((~) * a b, Conjoined p) => Comonad (Pretext p a b) # | |
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
.
PretextT | |
|
Corepresentable p => Sellable p (PretextT p g) # | |
((~) * a b, Conjoined p) => ComonadStore a (PretextT p g a b) # | |
Conjoined p => IndexedComonadStore (PretextT p g) # | |
Conjoined p => IndexedComonad (PretextT p g) # | |
IndexedFunctor (PretextT p g) # | |
Functor (PretextT p g a b) # | |
(Profunctor p, Contravariant g) => Contravariant (PretextT p g a b) # | |
((~) * a b, Conjoined p) => Comonad (PretextT p g a b) # | |