| Portability | Rank2Types |
|---|---|
| Stability | provisional |
| Maintainer | Edward Kmett <ekmett@gmail.com> |
| Safe Haskell | Trustworthy |
Control.Lens.Internal
Contents
Description
These are some of the explicit Functor instances that leak into the type signatures of Control.Lens. You shouldn't need to import this module directly, unless you are coming up with a whole new kind of "Family" and need to add instances.
- newtype May a = May {}
- newtype Folding f a = Folding {
- getFolding :: f a
- newtype Effect m r a = Effect {
- getEffect :: m r
- newtype EffectRWS w st m s a = EffectRWS {
- getEffectRWS :: st -> m (s, st, w)
- newtype Accessor r a = Accessor {
- runAccessor :: r
- newtype Err e a = Err {}
- newtype Traversed f = Traversed {
- getTraversed :: f ()
- newtype Sequenced m = Sequenced {
- getSequenced :: m ()
- newtype Focusing m s a = Focusing {
- unfocusing :: m (s, a)
- newtype FocusingWith w m s a = FocusingWith {
- unfocusingWith :: m (s, a, w)
- newtype FocusingPlus w k s a = FocusingPlus {
- unfocusingPlus :: k (s, w) a
- newtype FocusingOn f k s a = FocusingOn {
- unfocusingOn :: k (f s) a
- newtype FocusingMay k s a = FocusingMay {
- unfocusingMay :: k (May s) a
- newtype FocusingErr e k s a = FocusingErr {
- unfocusingErr :: k (Err e s) a
- newtype Mutator a = Mutator {
- runMutator :: a
- newtype Bazaar a b t = Bazaar {
- runBazaar :: forall f. Applicative f => (a -> f b) -> f t
- bazaar :: Applicative f => (a -> f b) -> Bazaar a b t -> f t
- duplicateBazaar :: Bazaar a c t -> Bazaar a b (Bazaar b c t)
- sell :: a -> Bazaar a b b
- newtype BazaarT a b g t = BazaarT {
- runBazaarT :: forall f. Applicative f => (a -> f b) -> f t
- bazaarT :: Applicative f => (a -> f b) -> BazaarT a b g t -> f t
- duplicateBazaarT :: BazaarT a c f t -> BazaarT a b f (BazaarT b c f t)
- sellT :: a -> BazaarT a b f b
- data Context a b t = Context (b -> t) a
- data Max a
- getMax :: Max a -> Maybe a
- data Min a
- getMin :: Min a -> Maybe a
- newtype Indexing f a = Indexing {
- runIndexing :: Int -> (f a, Int)
- newtype Indexing64 f a = Indexing64 {
- runIndexing64 :: Int64 -> (f a, Int64)
- data Prismoid ab st where
- data Isoid ab st where
- newtype Indexed i a b = Indexed {
- withIndex :: (i -> a) -> b
- type family CoA x :: *
- type family CoB x :: *
Internal Types
newtype Folding f a
A Monoid for a Gettable Applicative.
Constructors
| Folding | |
Fields
| |
Instances
| (Gettable f, Applicative f) => Monoid (Folding f a) |
newtype Effect m r a
Wrap a monadic effect with a phantom type argument.
newtype EffectRWS w st m s a
Wrap a monadic effect with a phantom type argument. Used when magnifying RWST.
Constructors
| EffectRWS | |
Fields
| |
newtype Accessor r a
Used instead of Const to report
No instance of (SettableAccessor)
when the user attempts to misuse a Setter as a
Getter, rather than a monolithic unification error.
Constructors
| Accessor | |
Fields
| |
newtype Traversed f
Used internally by traverseOf_ and the like.
Constructors
| Traversed | |
Fields
| |
Instances
| Applicative f => Monoid (Traversed f) |
newtype Sequenced m
Used internally by mapM_ and the like.
Constructors
| Sequenced | |
Fields
| |
newtype Focusing m s a
Constructors
| Focusing | |
Fields
| |
newtype FocusingWith w m s a
Constructors
| FocusingWith | |
Fields
| |
Instances
| Monad m => Functor (FocusingWith w m s) | |
| (Monad m, Monoid s, Monoid w) => Applicative (FocusingWith w m s) | |
| (Monoid w, Monad z) => Zoom (RWST r w s z) (RWST r w t z) (FocusingWith w z) s t | |
| (Monoid w, Monad z) => Zoom (RWST r w s z) (RWST r w t z) (FocusingWith w z) s t |
newtype FocusingPlus w k s a
Constructors
| FocusingPlus | |
Fields
| |
Instances
| (Monoid w, Zoom m n k s t) => Zoom (WriterT w m) (WriterT w n) (FocusingPlus w k) s t | |
| (Monoid w, Zoom m n k s t) => Zoom (WriterT w m) (WriterT w n) (FocusingPlus w k) s t | |
| Functor (k (s, w)) => Functor (FocusingPlus w k s) | |
| (Monoid w, Applicative (k (s, w))) => Applicative (FocusingPlus w k s) |
newtype FocusingOn f k s a
Constructors
| FocusingOn | |
Fields
| |
Instances
| Zoom m n k s t => Zoom (ListT m) (ListT n) (FocusingOn [] k) s t | |
| Functor (k (f s)) => Functor (FocusingOn f k s) | |
| Applicative (k (f s)) => Applicative (FocusingOn f k s) |
newtype FocusingMay k s a
Constructors
| FocusingMay | |
Fields
| |
Instances
| Zoom m n k s t => Zoom (MaybeT m) (MaybeT n) (FocusingMay k) s t | |
| Functor (k (May s)) => Functor (FocusingMay k s) | |
| Applicative (k (May s)) => Applicative (FocusingMay k s) |
newtype FocusingErr e k s a
Constructors
| FocusingErr | |
Fields
| |
Instances
| (Error e, Zoom m n k s t) => Zoom (ErrorT e m) (ErrorT e n) (FocusingErr e k) s t | |
| Functor (k (Err e s)) => Functor (FocusingErr e k s) | |
| Applicative (k (Err e s)) => Applicative (FocusingErr e k s) |
newtype Mutator a
Mutator is just a renamed Identity functor to give better error
messages when someone attempts to use a getter as a setter.
Most user code will never need to see this type.
Constructors
| Mutator | |
Fields
| |
newtype Bazaar a b t
This is used to characterize a Traversal.
a.k.a. indexed Cartesian store comonad, indexed Kleene store comonad, or an indexed FunList.
http://twanvl.nl/blog/haskell/non-regular1
is isomorphic to Bazaar a b tdata Bazaar a b t = Buy t | Trade (Bazaar a b (b -> t)) a,
and to exists s. (s, .
Traversal s t a b)
A Bazaar is like a Traversal that has already been applied to some structure.
Where a holds an Context a b ta and a function from b to
t, a holds N Bazaar a b tas and a function from N
bs to t.
Mnemonically, a Bazaar holds many stores and you can easily add more.
This is a final encoding of Bazaar.
Constructors
| Bazaar | |
Fields
| |
Instances
| Functor (Bazaar a b) | |
| Applicative (Bazaar a b) | |
| ~ * a b => Comonad (Bazaar a b) | |
| ~ * a b => ComonadApply (Bazaar a b) |
bazaar :: Applicative f => (a -> f b) -> Bazaar a b t -> f t
newtype BazaarT a b g t
BazaarT is like Bazaar, except that it provides a questionable Gettable instance
To protect this instance it relies on the soundness of another Gettable type, and usage conventions.
For example. This lets us write a suitably polymorphic and lazy taking, but there
must be a better way!
Constructors
| BazaarT | |
Fields
| |
bazaarT :: Applicative f => (a -> f b) -> BazaarT a b g t -> f t
Extract from a BazaarT.
bazaarT=fliprunBazaarT
duplicateBazaarT :: BazaarT a c f t -> BazaarT a b f (BazaarT b c f t)
data Context a b t
The indexed store can be used to characterize a Lens
and is used by clone
is isomorphic to
Context a b tnewtype 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 |
newtype Indexing f a
Constructors
| Indexing | |
Fields
| |
Instances
| Functor f => Functor (Indexing f) | |
| Applicative f => Applicative (Indexing f) | |
| Gettable f => Gettable (Indexing f) |
newtype Indexing64 f a
Constructors
| Indexing64 | |
Fields
| |
Instances
| Functor f => Functor (Indexing64 f) | |
| Applicative f => Applicative (Indexing64 f) | |
| Gettable f => Gettable (Indexing64 f) |
Overloadings
data Prismoid ab st where
This data type is used to capture all of the information provided by the
Prismatic class, so you can turn a Prism around into a Getter or
otherwise muck around with its internals.
If you see a function that expects a Prismoid or APrism, it is probably
just expecting a Prism.
newtype Indexed i a b
A function with access to a index. This constructor may be useful when you need to store
a Indexable in a container to avoid ImpredicativeTypes.
type family CoA x :: *
Extract a from the type a -> f b
type family CoB x :: *
Extract b from the type a -> f b