lens-5.3.5: Lenses, Folds and Traversals

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 | Trustworthy
Language | Haskell2010

Control.Lens.Internal.Zoom

Contents

- Zoom
- Magnify

Description

Synopsis

- newtype Focusing (m :: Type -> Type) s a = Focusing {
  - unfocusing :: m (s, a)
  }
- newtype FocusingWith w (m :: Type -> Type) s a = FocusingWith {
  - unfocusingWith :: m (s, a, w)
  }
- newtype FocusingPlus w (k :: Type -> Type -> Type) s a = FocusingPlus {
  - unfocusingPlus :: k (s, w) a
  }
- newtype FocusingOn (f :: Type -> Type) (k :: Type -> Type -> Type) s a = FocusingOn {
  - unfocusingOn :: k (f s) a
  }
- newtype FocusingMay (k :: Type -> Type -> Type) s a = FocusingMay {
  - unfocusingMay :: k (May s) a
  }
- newtype May a = May {
  - getMay :: Maybe a
  }
- newtype FocusingErr e (k :: Type -> Type -> Type) s a = FocusingErr {
  - unfocusingErr :: k (Err e s) a
  }
- newtype Err e a = Err {
  - getErr :: Either e a
  }
- newtype FocusingFree (f :: Type -> Type) (m :: Type -> Type) (k :: Type -> Type -> Type) s a = FocusingFree {
  - unfocusingFree :: k (Freed f m s) a
  }
- newtype Freed (f :: Type -> Type) (m :: Type -> Type) a = Freed {
  - getFreed :: FreeF f a (FreeT f m a)
  }
- newtype Effect (m :: Type -> Type) r a = Effect {
  - getEffect :: m r
  }
- newtype EffectRWS w st (m :: Type -> Type) s a = EffectRWS {
  - getEffectRWS :: st -> m (s, st, w)
  }

# Zoom

newtype Focusing (m :: Type -> Type) s a Source #

Used by `Zoom` to `zoom` into `StateT`.

Constructors

Focusing |

Fields

- unfocusing :: m (s, a)

#### Instances

Instances details

(Monad m, Monoid s) => Applicative (Focusing m s) Source # |
Instance details Defined in Control.Lens.Internal.Zoom Methods pure :: a -> Focusing m s a Source # (<*>) :: Focusing m s (a -> b) -> Focusing m s a -> Focusing m s b Source # liftA2 :: (a -> b -> c) -> Focusing m s a -> Focusing m s b -> Focusing m s c Source # (*>) :: Focusing m s a -> Focusing m s b -> Focusing m s b Source # (<*) :: Focusing m s a -> Focusing m s b -> Focusing m s a Source #
Monad m => Functor (Focusing m s) Source # |
Instance details Defined in Control.Lens.Internal.Zoom Methods fmap :: (a -> b) -> Focusing m s a -> Focusing m s b Source # (<$) :: a -> Focusing m s b -> Focusing m s a Source #
(Monad m, Semigroup s) => Apply (Focusing m s) Source # |
Instance details Defined in Control.Lens.Internal.Zoom Methods (<.>) :: Focusing m s (a -> b) -> Focusing m s a -> Focusing m s b Source # (.>) :: Focusing m s a -> Focusing m s b -> Focusing m s b Source # (<.) :: Focusing m s a -> Focusing m s b -> Focusing m s a Source # liftF2 :: (a -> b -> c) -> Focusing m s a -> Focusing m s b -> Focusing m s c Source #

newtype FocusingWith w (m :: Type -> Type) s a Source #

Used by `Zoom` to `zoom` into `RWST`.

Constructors

FocusingWith |

Fields

- unfocusingWith :: m (s, a, w)

#### Instances

Instances details

(Monad m, Monoid s, Monoid w) => Applicative (FocusingWith w m s) Source # |

Instance details

Defined in Control.Lens.Internal.Zoom

Methods

pure :: a -> FocusingWith w m s a Source #

(<*>) :: FocusingWith w m s (a -> b) -> FocusingWith w m s a -> FocusingWith w m s b Source #

liftA2 :: (a -> b -> c) -> FocusingWith w m s a -> FocusingWith w m s b -> FocusingWith w m s c Source #

(*>) :: FocusingWith w m s a -> FocusingWith w m s b -> FocusingWith w m s b Source #

(<*) :: FocusingWith w m s a -> FocusingWith w m s b -> FocusingWith w m s a Source #

Monad m => Functor (FocusingWith w m s) Source # |
Instance details Defined in Control.Lens.Internal.Zoom Methods fmap :: (a -> b) -> FocusingWith w m s a -> FocusingWith w m s b Source # (<$) :: a -> FocusingWith w m s b -> FocusingWith w m s a Source #
(Monad m, Semigroup s, Semigroup w) => Apply (FocusingWith w m s) Source # |

Instance details

Defined in Control.Lens.Internal.Zoom

Methods

(<.>) :: FocusingWith w m s (a -> b) -> FocusingWith w m s a -> FocusingWith w m s b Source #

(.>) :: FocusingWith w m s a -> FocusingWith w m s b -> FocusingWith w m s b Source #

(<.) :: FocusingWith w m s a -> FocusingWith w m s b -> FocusingWith w m s a Source #

liftF2 :: (a -> b -> c) -> FocusingWith w m s a -> FocusingWith w m s b -> FocusingWith w m s c Source #

newtype FocusingPlus w (k :: Type -> Type -> Type) s a Source #

Used by `Zoom` to `zoom` into `WriterT`.

Constructors

FocusingPlus |

Fields

- unfocusingPlus :: k (s, w) a

#### Instances

Instances details

Applicative (k (s, w)) => Applicative (FocusingPlus w k s) Source # |

Instance details

Defined in Control.Lens.Internal.Zoom

Methods

pure :: a -> FocusingPlus w k s a Source #

(<*>) :: FocusingPlus w k s (a -> b) -> FocusingPlus w k s a -> FocusingPlus w k s b Source #

liftA2 :: (a -> b -> c) -> FocusingPlus w k s a -> FocusingPlus w k s b -> FocusingPlus w k s c Source #

(*>) :: FocusingPlus w k s a -> FocusingPlus w k s b -> FocusingPlus w k s b Source #

(<*) :: FocusingPlus w k s a -> FocusingPlus w k s b -> FocusingPlus w k s a Source #

Functor (k (s, w)) => Functor (FocusingPlus w k s) Source # |
Instance details Defined in Control.Lens.Internal.Zoom Methods fmap :: (a -> b) -> FocusingPlus w k s a -> FocusingPlus w k s b Source # (<$) :: a -> FocusingPlus w k s b -> FocusingPlus w k s a Source #
Apply (k (s, w)) => Apply (FocusingPlus w k s) Source # |

Instance details

Defined in Control.Lens.Internal.Zoom

Methods

(<.>) :: FocusingPlus w k s (a -> b) -> FocusingPlus w k s a -> FocusingPlus w k s b Source #

(.>) :: FocusingPlus w k s a -> FocusingPlus w k s b -> FocusingPlus w k s b Source #

(<.) :: FocusingPlus w k s a -> FocusingPlus w k s b -> FocusingPlus w k s a Source #

liftF2 :: (a -> b -> c) -> FocusingPlus w k s a -> FocusingPlus w k s b -> FocusingPlus w k s c Source #

newtype FocusingOn (f :: Type -> Type) (k :: Type -> Type -> Type) s a Source #

Used by `Zoom` to `zoom` into `MaybeT` or `ListT`.

Constructors

FocusingOn |

Fields

- unfocusingOn :: k (f s) a

#### Instances

Instances details

Applicative (k (f s)) => Applicative (FocusingOn f k s) Source # |

Instance details

Defined in Control.Lens.Internal.Zoom

Methods

pure :: a -> FocusingOn f k s a Source #

(<*>) :: FocusingOn f k s (a -> b) -> FocusingOn f k s a -> FocusingOn f k s b Source #

liftA2 :: (a -> b -> c) -> FocusingOn f k s a -> FocusingOn f k s b -> FocusingOn f k s c Source #

(*>) :: FocusingOn f k s a -> FocusingOn f k s b -> FocusingOn f k s b Source #

(<*) :: FocusingOn f k s a -> FocusingOn f k s b -> FocusingOn f k s a Source #

Functor (k (f s)) => Functor (FocusingOn f k s) Source # |
Instance details Defined in Control.Lens.Internal.Zoom Methods fmap :: (a -> b) -> FocusingOn f k s a -> FocusingOn f k s b Source # (<$) :: a -> FocusingOn f k s b -> FocusingOn f k s a Source #
Apply (k (f s)) => Apply (FocusingOn f k s) Source # |

Instance details

Defined in Control.Lens.Internal.Zoom

Methods

(<.>) :: FocusingOn f k s (a -> b) -> FocusingOn f k s a -> FocusingOn f k s b Source #

(.>) :: FocusingOn f k s a -> FocusingOn f k s b -> FocusingOn f k s b Source #

(<.) :: FocusingOn f k s a -> FocusingOn f k s b -> FocusingOn f k s a Source #

liftF2 :: (a -> b -> c) -> FocusingOn f k s a -> FocusingOn f k s b -> FocusingOn f k s c Source #

newtype FocusingMay (k :: Type -> Type -> Type) s a Source #

Used by `Zoom` to `zoom` into `ErrorT`.

Constructors

FocusingMay |

Fields

- unfocusingMay :: k (May s) a

#### Instances

Instances details

Applicative (k (May s)) => Applicative (FocusingMay k s) Source # |

Instance details

Defined in Control.Lens.Internal.Zoom

Methods

pure :: a -> FocusingMay k s a Source #

(<*>) :: FocusingMay k s (a -> b) -> FocusingMay k s a -> FocusingMay k s b Source #

liftA2 :: (a -> b -> c) -> FocusingMay k s a -> FocusingMay k s b -> FocusingMay k s c Source #

(*>) :: FocusingMay k s a -> FocusingMay k s b -> FocusingMay k s b Source #

(<*) :: FocusingMay k s a -> FocusingMay k s b -> FocusingMay k s a Source #

Functor (k (May s)) => Functor (FocusingMay k s) Source # |
Instance details Defined in Control.Lens.Internal.Zoom Methods fmap :: (a -> b) -> FocusingMay k s a -> FocusingMay k s b Source # (<$) :: a -> FocusingMay k s b -> FocusingMay k s a Source #
Apply (k (May s)) => Apply (FocusingMay k s) Source # |
Instance details Defined in Control.Lens.Internal.Zoom Methods (<.>) :: FocusingMay k s (a -> b) -> FocusingMay k s a -> FocusingMay k s b Source # (.>) :: FocusingMay k s a -> FocusingMay k s b -> FocusingMay k s b Source # (<.) :: FocusingMay k s a -> FocusingMay k s b -> FocusingMay k s a Source # liftF2 :: (a -> b -> c) -> FocusingMay k s a -> FocusingMay k s b -> FocusingMay k s c Source #

newtype May a Source #

Make a `Monoid` out of `Maybe` for error handling.

Constructors

May |

Fields

- getMay :: Maybe a

#### Instances

Instances details

Monoid a => Monoid (May a) Source # |
Instance details Defined in Control.Lens.Internal.Zoom Methods mempty :: May a Source # mappend :: May a -> May a -> May a Source # mconcat :: [May a] -> May a Source #
Semigroup a => Semigroup (May a) Source # |
Instance details Defined in Control.Lens.Internal.Zoom Methods (<>) :: May a -> May a -> May a Source # sconcat :: NonEmpty (May a) -> May a Source # stimes :: Integral b => b -> May a -> May a Source #

newtype FocusingErr e (k :: Type -> Type -> Type) s a Source #

Used by `Zoom` to `zoom` into `ErrorT`.

Constructors

FocusingErr |

Fields

- unfocusingErr :: k (Err e s) a

#### Instances

Instances details

Applicative (k (Err e s)) => Applicative (FocusingErr e k s) Source # |

Instance details

Defined in Control.Lens.Internal.Zoom

Methods

pure :: a -> FocusingErr e k s a Source #

(<*>) :: FocusingErr e k s (a -> b) -> FocusingErr e k s a -> FocusingErr e k s b Source #

liftA2 :: (a -> b -> c) -> FocusingErr e k s a -> FocusingErr e k s b -> FocusingErr e k s c Source #

(*>) :: FocusingErr e k s a -> FocusingErr e k s b -> FocusingErr e k s b Source #

(<*) :: FocusingErr e k s a -> FocusingErr e k s b -> FocusingErr e k s a Source #

Functor (k (Err e s)) => Functor (FocusingErr e k s) Source # |
Instance details Defined in Control.Lens.Internal.Zoom Methods fmap :: (a -> b) -> FocusingErr e k s a -> FocusingErr e k s b Source # (<$) :: a -> FocusingErr e k s b -> FocusingErr e k s a Source #
Apply (k (Err e s)) => Apply (FocusingErr e k s) Source # |

Instance details

Defined in Control.Lens.Internal.Zoom

Methods

(<.>) :: FocusingErr e k s (a -> b) -> FocusingErr e k s a -> FocusingErr e k s b Source #

(.>) :: FocusingErr e k s a -> FocusingErr e k s b -> FocusingErr e k s b Source #

(<.) :: FocusingErr e k s a -> FocusingErr e k s b -> FocusingErr e k s a Source #

liftF2 :: (a -> b -> c) -> FocusingErr e k s a -> FocusingErr e k s b -> FocusingErr e k s c Source #

newtype Err e a Source #

Make a `Monoid` out of `Either` for error handling.

Constructors

Err |

Fields

- getErr :: Either e a

#### Instances

Instances details

Monoid a => Monoid (Err e a) Source # |
Instance details Defined in Control.Lens.Internal.Zoom Methods mempty :: Err e a Source # mappend :: Err e a -> Err e a -> Err e a Source # mconcat :: [Err e a] -> Err e a Source #
Semigroup a => Semigroup (Err e a) Source # |
Instance details Defined in Control.Lens.Internal.Zoom Methods (<>) :: Err e a -> Err e a -> Err e a Source # sconcat :: NonEmpty (Err e a) -> Err e a Source # stimes :: Integral b => b -> Err e a -> Err e a Source #

newtype FocusingFree (f :: Type -> Type) (m :: Type -> Type) (k :: Type -> Type -> Type) s a Source #

Used by `Zoom` to `zoom` into `FreeT`

Constructors

FocusingFree |

Fields

- unfocusingFree :: k (Freed f m s) a

#### Instances

Instances details

Applicative (k (Freed f m s)) => Applicative (FocusingFree f m k s) Source # |

Instance details

Defined in Control.Lens.Internal.Zoom

Methods

pure :: a -> FocusingFree f m k s a Source #

(<*>) :: FocusingFree f m k s (a -> b) -> FocusingFree f m k s a -> FocusingFree f m k s b Source #

liftA2 :: (a -> b -> c) -> FocusingFree f m k s a -> FocusingFree f m k s b -> FocusingFree f m k s c Source #

(*>) :: FocusingFree f m k s a -> FocusingFree f m k s b -> FocusingFree f m k s b Source #

(<*) :: FocusingFree f m k s a -> FocusingFree f m k s b -> FocusingFree f m k s a Source #

Functor (k (Freed f m s)) => Functor (FocusingFree f m k s) Source # |
Instance details Defined in Control.Lens.Internal.Zoom Methods fmap :: (a -> b) -> FocusingFree f m k s a -> FocusingFree f m k s b Source # (<$) :: a -> FocusingFree f m k s b -> FocusingFree f m k s a Source #
Apply (k (Freed f m s)) => Apply (FocusingFree f m k s) Source # |

Instance details

Defined in Control.Lens.Internal.Zoom

Methods

(<.>) :: FocusingFree f m k s (a -> b) -> FocusingFree f m k s a -> FocusingFree f m k s b Source #

(.>) :: FocusingFree f m k s a -> FocusingFree f m k s b -> FocusingFree f m k s b Source #

(<.) :: FocusingFree f m k s a -> FocusingFree f m k s b -> FocusingFree f m k s a Source #

liftF2 :: (a -> b -> c) -> FocusingFree f m k s a -> FocusingFree f m k s b -> FocusingFree f m k s c Source #

newtype Freed (f :: Type -> Type) (m :: Type -> Type) a Source #

Make a `Monoid` out of `FreeF` for result collection.

Constructors

Freed |

Fields

- getFreed :: FreeF f a (FreeT f m a)

#### Instances

Instances details

(Applicative f, Monoid a, Monad m) => Monoid (Freed f m a) Source # |
Instance details Defined in Control.Lens.Internal.Zoom Methods mempty :: Freed f m a Source # mappend :: Freed f m a -> Freed f m a -> Freed f m a Source # mconcat :: [Freed f m a] -> Freed f m a Source #
(Applicative f, Semigroup a, Monad m) => Semigroup (Freed f m a) Source # |
Instance details Defined in Control.Lens.Internal.Zoom Methods (<>) :: Freed f m a -> Freed f m a -> Freed f m a Source # sconcat :: NonEmpty (Freed f m a) -> Freed f m a Source # stimes :: Integral b => b -> Freed f m a -> Freed f m a Source #

# Magnify

newtype Effect (m :: Type -> Type) r a Source #

Wrap a monadic effect with a phantom type argument.

Constructors

Effect |

Fields

- getEffect :: m r

#### Instances

Instances details

Contravariant (Effect m r) Source # |
Instance details Defined in Control.Lens.Internal.Zoom Methods contramap :: (a' -> a) -> Effect m r a -> Effect m r a' Source # (>$) :: b -> Effect m r b -> Effect m r a Source #
(Monad m, Monoid r) => Applicative (Effect m r) Source # |
Instance details Defined in Control.Lens.Internal.Zoom Methods pure :: a -> Effect m r a Source # (<*>) :: Effect m r (a -> b) -> Effect m r a -> Effect m r b Source # liftA2 :: (a -> b -> c) -> Effect m r a -> Effect m r b -> Effect m r c Source # (*>) :: Effect m r a -> Effect m r b -> Effect m r b Source # (<*) :: Effect m r a -> Effect m r b -> Effect m r a Source #
Functor (Effect m r) Source # |
Instance details Defined in Control.Lens.Internal.Zoom Methods fmap :: (a -> b) -> Effect m r a -> Effect m r b Source # (<$) :: a -> Effect m r b -> Effect m r a Source #
(Apply m, Semigroup r) => Apply (Effect m r) Source # |
Instance details Defined in Control.Lens.Internal.Zoom Methods (<.>) :: Effect m r (a -> b) -> Effect m r a -> Effect m r b Source # (.>) :: Effect m r a -> Effect m r b -> Effect m r b Source # (<.) :: Effect m r a -> Effect m r b -> Effect m r a Source # liftF2 :: (a -> b -> c) -> Effect m r a -> Effect m r b -> Effect m r c Source #
(Monad m, Monoid r) => Monoid (Effect m r a) Source # |
Instance details Defined in Control.Lens.Internal.Zoom Methods mempty :: Effect m r a Source # mappend :: Effect m r a -> Effect m r a -> Effect m r a Source # mconcat :: [Effect m r a] -> Effect m r a Source #
(Monad m, Semigroup r) => Semigroup (Effect m r a) Source # |
Instance details Defined in Control.Lens.Internal.Zoom Methods (<>) :: Effect m r a -> Effect m r a -> Effect m r a Source # sconcat :: NonEmpty (Effect m r a) -> Effect m r a Source # stimes :: Integral b => b -> Effect m r a -> Effect m r a Source #

newtype EffectRWS w st (m :: Type -> Type) 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

Instances details

Contravariant (EffectRWS w st m s) Source # |
Instance details Defined in Control.Lens.Internal.Zoom Methods contramap :: (a' -> a) -> EffectRWS w st m s a -> EffectRWS w st m s a' Source # (>$) :: b -> EffectRWS w st m s b -> EffectRWS w st m s a Source #
(Monoid s, Monoid w, Monad m) => Applicative (EffectRWS w st m s) Source # |

Instance details

Defined in Control.Lens.Internal.Zoom

Methods

pure :: a -> EffectRWS w st m s a Source #

(<*>) :: EffectRWS w st m s (a -> b) -> EffectRWS w st m s a -> EffectRWS w st m s b Source #

liftA2 :: (a -> b -> c) -> EffectRWS w st m s a -> EffectRWS w st m s b -> EffectRWS w st m s c Source #

(*>) :: EffectRWS w st m s a -> EffectRWS w st m s b -> EffectRWS w st m s b Source #

(<*) :: EffectRWS w st m s a -> EffectRWS w st m s b -> EffectRWS w st m s a Source #

Functor (EffectRWS w st m s) Source # |
Instance details Defined in Control.Lens.Internal.Zoom Methods fmap :: (a -> b) -> EffectRWS w st m s a -> EffectRWS w st m s b Source # (<$) :: a -> EffectRWS w st m s b -> EffectRWS w st m s a Source #
(Semigroup s, Semigroup w, Bind m) => Apply (EffectRWS w st m s) Source # |

Instance details

Defined in Control.Lens.Internal.Zoom

Methods

(<.>) :: EffectRWS w st m s (a -> b) -> EffectRWS w st m s a -> EffectRWS w st m s b Source #

(.>) :: EffectRWS w st m s a -> EffectRWS w st m s b -> EffectRWS w st m s b Source #

(<.) :: EffectRWS w st m s a -> EffectRWS w st m s b -> EffectRWS w st m s a Source #

liftF2 :: (a -> b -> c) -> EffectRWS w st m s a -> EffectRWS w st m s b -> EffectRWS w st m s c Source #