lens-4.1.2.1: Lenses, Folds and Traversals

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

Control.Lens.Internal.Zoom

Contents

Description

 

Synopsis

Zoom

type family Zoomed m :: * -> * -> * Source

This type family is used by Zoom to describe the common effect type.

Instances

type Zoomed (ListT m) = FocusingOn [] (Zoomed m) 
type Zoomed (MaybeT m) = FocusingMay (Zoomed m) 
type Zoomed (IdentityT m) = Zoomed m 
type Zoomed (ErrorT e m) = FocusingErr e (Zoomed m) 
type Zoomed (ReaderT e m) = Zoomed m 
type Zoomed (StateT s z) = Focusing z 
type Zoomed (StateT s z) = Focusing z 
type Zoomed (WriterT w m) = FocusingPlus w (Zoomed m) 
type Zoomed (WriterT w m) = FocusingPlus w (Zoomed m) 
type Zoomed (RWST r w s z) = FocusingWith w z 
type Zoomed (RWST r w s z) = FocusingWith w z 

newtype Focusing m s a Source

Used by Zoom to zoom into StateT.

Constructors

Focusing 

Fields

unfocusing :: m (s, a)
 

Instances

Monad m => Functor (Focusing m s) 
(Monad m, Monoid s) => Applicative (Focusing m s) 
(Monad m, Semigroup s) => Apply (Focusing m s) 

newtype FocusingWith w m s a Source

Used by Zoom to zoom into RWST.

Constructors

FocusingWith 

Fields

unfocusingWith :: m (s, a, w)
 

Instances

Monad m => Functor (FocusingWith w m s) 
(Monad m, Monoid s, Monoid w) => Applicative (FocusingWith w m s) 
(Monad m, Semigroup s, Semigroup w) => Apply (FocusingWith w m s) 

newtype FocusingPlus w k s a Source

Used by Zoom to zoom into WriterT.

Constructors

FocusingPlus 

Fields

unfocusingPlus :: k (s, w) a
 

Instances

Functor (k (s, w)) => Functor (FocusingPlus w k s) 
Applicative (k (s, w)) => Applicative (FocusingPlus w k s) 
Apply (k (s, w)) => Apply (FocusingPlus w k s) 

newtype FocusingOn f k s a Source

Used by Zoom to zoom into MaybeT or ListT.

Constructors

FocusingOn 

Fields

unfocusingOn :: k (f s) a
 

Instances

Functor (k (f s)) => Functor (FocusingOn f k s) 
Applicative (k (f s)) => Applicative (FocusingOn f k s) 
Apply (k (f s)) => Apply (FocusingOn f k s) 

newtype FocusingMay k s a Source

Used by Zoom to zoom into ErrorT.

Constructors

FocusingMay 

Fields

unfocusingMay :: k (May s) a
 

Instances

Functor (k (May s)) => Functor (FocusingMay k s) 
Applicative (k (May s)) => Applicative (FocusingMay k s) 
Apply (k (May s)) => Apply (FocusingMay k s) 

newtype May a Source

Make a Monoid out of Maybe for error handling.

Constructors

May 

Fields

getMay :: Maybe a
 

Instances

Monoid a => Monoid (May a) 
Semigroup a => Semigroup (May a) 

newtype FocusingErr e k s a Source

Used by Zoom to zoom into ErrorT.

Constructors

FocusingErr 

Fields

unfocusingErr :: k (Err e s) a
 

Instances

Functor (k (Err e s)) => Functor (FocusingErr e k s) 
Applicative (k (Err e s)) => Applicative (FocusingErr e k s) 
Apply (k (Err e s)) => Apply (FocusingErr e k s) 

newtype Err e a Source

Make a Monoid out of Either for error handling.

Constructors

Err 

Fields

getErr :: Either e a
 

Instances

Monoid a => Monoid (Err e a) 
Semigroup a => Semigroup (Err e a) 

Magnify

type family Magnified m :: * -> * -> * Source

This type family is used by Magnify to describe the common effect type.

Instances

type Magnified ((->) b) = Const 
type Magnified (IdentityT m) = Magnified m 
type Magnified (ReaderT b m) = Effect m 
type Magnified (RWST a w s m) = EffectRWS w s m 
type Magnified (RWST a w s m) = EffectRWS w s m 

newtype EffectRWS w st m s a Source

Wrap a monadic effect with a phantom type argument. Used when magnifying RWST.

Constructors

EffectRWS 

Fields

getEffectRWS :: st -> m (s, st, w)
 

Instances

Functor (EffectRWS w st m s) 
(Monoid s, Monoid w, Monad m) => Applicative (EffectRWS w st m s) 
Contravariant (EffectRWS w st m s) 
(Semigroup s, Semigroup w, Bind m) => Apply (EffectRWS w st m s)