lens-5.3: Lenses, Folds and Traversals
Copyright(C) 2012-16 Edward Kmett
LicenseBSD-style (see the file LICENSE)
MaintainerEdward Kmett <ekmett@gmail.com>
Stabilityprovisional
PortabilityRank2Types
Safe HaskellSafe-Inferred
LanguageHaskell2010

Control.Lens.Reified

Description

 
Synopsis

Documentation

>>> import Control.Lens
>>> import Control.Applicative

newtype ReifiedLens s t a b Source #

Reify a Lens so it can be stored safely in a container.

Constructors

Lens 

Fields

newtype ReifiedIndexedLens i s t a b Source #

Reify an IndexedLens so it can be stored safely in a container.

Constructors

IndexedLens 

Fields

newtype ReifiedIndexedTraversal i s t a b Source #

Reify an IndexedTraversal so it can be stored safely in a container.

Constructors

IndexedTraversal 

newtype ReifiedTraversal s t a b Source #

A form of Traversal that can be stored monomorphically in a container.

Constructors

Traversal 

Fields

newtype ReifiedGetter s a Source #

Reify a Getter so it can be stored safely in a container.

This can also be useful when combining getters in novel ways, as ReifiedGetter is isomorphic to (->) and provides similar instances.

>>> ("hello","world","!!!")^.runGetter ((,) <$> Getter _2 <*> Getter (_1.to length))
("world",5)

Constructors

Getter 

Fields

Instances

Instances details
Arrow ReifiedGetter Source # 
Instance details

Defined in Control.Lens.Reified

Methods

arr :: (b -> c) -> ReifiedGetter b c #

first :: ReifiedGetter b c -> ReifiedGetter (b, d) (c, d) #

second :: ReifiedGetter b c -> ReifiedGetter (d, b) (d, c) #

(***) :: ReifiedGetter b c -> ReifiedGetter b' c' -> ReifiedGetter (b, b') (c, c') #

(&&&) :: ReifiedGetter b c -> ReifiedGetter b c' -> ReifiedGetter b (c, c') #

ArrowApply ReifiedGetter Source # 
Instance details

Defined in Control.Lens.Reified

Methods

app :: ReifiedGetter (ReifiedGetter b c, b) c #

ArrowChoice ReifiedGetter Source # 
Instance details

Defined in Control.Lens.Reified

Methods

left :: ReifiedGetter b c -> ReifiedGetter (Either b d) (Either c d) #

right :: ReifiedGetter b c -> ReifiedGetter (Either d b) (Either d c) #

(+++) :: ReifiedGetter b c -> ReifiedGetter b' c' -> ReifiedGetter (Either b b') (Either c c') #

(|||) :: ReifiedGetter b d -> ReifiedGetter c d -> ReifiedGetter (Either b c) d #

ArrowLoop ReifiedGetter Source # 
Instance details

Defined in Control.Lens.Reified

Methods

loop :: ReifiedGetter (b, d) (c, d) -> ReifiedGetter b c #

Conjoined ReifiedGetter Source # 
Instance details

Defined in Control.Lens.Reified

Methods

distrib :: Functor f => ReifiedGetter a b -> ReifiedGetter (f a) (f b) Source #

conjoined :: (ReifiedGetter ~ (->) => q (a -> b) r) -> q (ReifiedGetter a b) r -> q (ReifiedGetter a b) r Source #

Choice ReifiedGetter Source # 
Instance details

Defined in Control.Lens.Reified

Methods

left' :: ReifiedGetter a b -> ReifiedGetter (Either a c) (Either b c) #

right' :: ReifiedGetter a b -> ReifiedGetter (Either c a) (Either c b) #

Closed ReifiedGetter Source # 
Instance details

Defined in Control.Lens.Reified

Methods

closed :: ReifiedGetter a b -> ReifiedGetter (x -> a) (x -> b) #

Corepresentable ReifiedGetter Source # 
Instance details

Defined in Control.Lens.Reified

Associated Types

type Corep ReifiedGetter :: Type -> Type #

Methods

cotabulate :: (Corep ReifiedGetter d -> c) -> ReifiedGetter d c #

Representable ReifiedGetter Source # 
Instance details

Defined in Control.Lens.Reified

Associated Types

type Rep ReifiedGetter :: Type -> Type #

Methods

tabulate :: (d -> Rep ReifiedGetter c) -> ReifiedGetter d c #

Costrong ReifiedGetter Source # 
Instance details

Defined in Control.Lens.Reified

Methods

unfirst :: ReifiedGetter (a, d) (b, d) -> ReifiedGetter a b #

unsecond :: ReifiedGetter (d, a) (d, b) -> ReifiedGetter a b #

Strong ReifiedGetter Source # 
Instance details

Defined in Control.Lens.Reified

Methods

first' :: ReifiedGetter a b -> ReifiedGetter (a, c) (b, c) #

second' :: ReifiedGetter a b -> ReifiedGetter (c, a) (c, b) #

Profunctor ReifiedGetter Source # 
Instance details

Defined in Control.Lens.Reified

Methods

dimap :: (a -> b) -> (c -> d) -> ReifiedGetter b c -> ReifiedGetter a d #

lmap :: (a -> b) -> ReifiedGetter b c -> ReifiedGetter a c #

rmap :: (b -> c) -> ReifiedGetter a b -> ReifiedGetter a c #

(#.) :: forall a b c q. Coercible c b => q b c -> ReifiedGetter a b -> ReifiedGetter a c #

(.#) :: forall a b c q. Coercible b a => ReifiedGetter b c -> q a b -> ReifiedGetter a c #

Category ReifiedGetter Source # 
Instance details

Defined in Control.Lens.Reified

Methods

id :: forall (a :: k). ReifiedGetter a a #

(.) :: forall (b :: k) (c :: k) (a :: k). ReifiedGetter b c -> ReifiedGetter a b -> ReifiedGetter a c #

Cosieve ReifiedGetter Identity Source # 
Instance details

Defined in Control.Lens.Reified

Methods

cosieve :: ReifiedGetter a b -> Identity a -> b #

Sieve ReifiedGetter Identity Source # 
Instance details

Defined in Control.Lens.Reified

Methods

sieve :: ReifiedGetter a b -> a -> Identity b #

MonadReader s (ReifiedGetter s) Source # 
Instance details

Defined in Control.Lens.Reified

Methods

ask :: ReifiedGetter s s #

local :: (s -> s) -> ReifiedGetter s a -> ReifiedGetter s a #

reader :: (s -> a) -> ReifiedGetter s a #

Applicative (ReifiedGetter s) Source # 
Instance details

Defined in Control.Lens.Reified

Methods

pure :: a -> ReifiedGetter s a #

(<*>) :: ReifiedGetter s (a -> b) -> ReifiedGetter s a -> ReifiedGetter s b #

liftA2 :: (a -> b -> c) -> ReifiedGetter s a -> ReifiedGetter s b -> ReifiedGetter s c #

(*>) :: ReifiedGetter s a -> ReifiedGetter s b -> ReifiedGetter s b #

(<*) :: ReifiedGetter s a -> ReifiedGetter s b -> ReifiedGetter s a #

Functor (ReifiedGetter s) Source # 
Instance details

Defined in Control.Lens.Reified

Methods

fmap :: (a -> b) -> ReifiedGetter s a -> ReifiedGetter s b #

(<$) :: a -> ReifiedGetter s b -> ReifiedGetter s a #

Monad (ReifiedGetter s) Source # 
Instance details

Defined in Control.Lens.Reified

Methods

(>>=) :: ReifiedGetter s a -> (a -> ReifiedGetter s b) -> ReifiedGetter s b #

(>>) :: ReifiedGetter s a -> ReifiedGetter s b -> ReifiedGetter s b #

return :: a -> ReifiedGetter s a #

Monoid s => Comonad (ReifiedGetter s) Source # 
Instance details

Defined in Control.Lens.Reified

Monoid s => ComonadApply (ReifiedGetter s) Source # 
Instance details

Defined in Control.Lens.Reified

Methods

(<@>) :: ReifiedGetter s (a -> b) -> ReifiedGetter s a -> ReifiedGetter s b #

(@>) :: ReifiedGetter s a -> ReifiedGetter s b -> ReifiedGetter s b #

(<@) :: ReifiedGetter s a -> ReifiedGetter s b -> ReifiedGetter s a #

Distributive (ReifiedGetter s) Source # 
Instance details

Defined in Control.Lens.Reified

Methods

distribute :: Functor f => f (ReifiedGetter s a) -> ReifiedGetter s (f a) #

collect :: Functor f => (a -> ReifiedGetter s b) -> f a -> ReifiedGetter s (f b) #

distributeM :: Monad m => m (ReifiedGetter s a) -> ReifiedGetter s (m a) #

collectM :: Monad m => (a -> ReifiedGetter s b) -> m a -> ReifiedGetter s (m b) #

Apply (ReifiedGetter s) Source # 
Instance details

Defined in Control.Lens.Reified

Methods

(<.>) :: ReifiedGetter s (a -> b) -> ReifiedGetter s a -> ReifiedGetter s b #

(.>) :: ReifiedGetter s a -> ReifiedGetter s b -> ReifiedGetter s b #

(<.) :: ReifiedGetter s a -> ReifiedGetter s b -> ReifiedGetter s a #

liftF2 :: (a -> b -> c) -> ReifiedGetter s a -> ReifiedGetter s b -> ReifiedGetter s c #

Bind (ReifiedGetter s) Source # 
Instance details

Defined in Control.Lens.Reified

Methods

(>>-) :: ReifiedGetter s a -> (a -> ReifiedGetter s b) -> ReifiedGetter s b #

join :: ReifiedGetter s (ReifiedGetter s a) -> ReifiedGetter s a #

Semigroup s => Extend (ReifiedGetter s) Source # 
Instance details

Defined in Control.Lens.Reified

type Corep ReifiedGetter Source # 
Instance details

Defined in Control.Lens.Reified

type Rep ReifiedGetter Source # 
Instance details

Defined in Control.Lens.Reified

newtype ReifiedIndexedGetter i s a Source #

Reify an IndexedGetter so it can be stored safely in a container.

Constructors

IndexedGetter 

Instances

Instances details
Representable (ReifiedIndexedGetter i) Source # 
Instance details

Defined in Control.Lens.Reified

Associated Types

type Rep (ReifiedIndexedGetter i) :: Type -> Type #

Methods

tabulate :: (d -> Rep (ReifiedIndexedGetter i) c) -> ReifiedIndexedGetter i d c #

Strong (ReifiedIndexedGetter i) Source # 
Instance details

Defined in Control.Lens.Reified

Methods

first' :: ReifiedIndexedGetter i a b -> ReifiedIndexedGetter i (a, c) (b, c) #

second' :: ReifiedIndexedGetter i a b -> ReifiedIndexedGetter i (c, a) (c, b) #

Profunctor (ReifiedIndexedGetter i) Source # 
Instance details

Defined in Control.Lens.Reified

Methods

dimap :: (a -> b) -> (c -> d) -> ReifiedIndexedGetter i b c -> ReifiedIndexedGetter i a d #

lmap :: (a -> b) -> ReifiedIndexedGetter i b c -> ReifiedIndexedGetter i a c #

rmap :: (b -> c) -> ReifiedIndexedGetter i a b -> ReifiedIndexedGetter i a c #

(#.) :: forall a b c q. Coercible c b => q b c -> ReifiedIndexedGetter i a b -> ReifiedIndexedGetter i a c #

(.#) :: forall a b c q. Coercible b a => ReifiedIndexedGetter i b c -> q a b -> ReifiedIndexedGetter i a c #

Sieve (ReifiedIndexedGetter i) ((,) i) Source # 
Instance details

Defined in Control.Lens.Reified

Methods

sieve :: ReifiedIndexedGetter i a b -> a -> (i, b) #

Functor (ReifiedIndexedGetter i s) Source # 
Instance details

Defined in Control.Lens.Reified

Methods

fmap :: (a -> b) -> ReifiedIndexedGetter i s a -> ReifiedIndexedGetter i s b #

(<$) :: a -> ReifiedIndexedGetter i s b -> ReifiedIndexedGetter i s a #

Semigroup i => Apply (ReifiedIndexedGetter i s) Source # 
Instance details

Defined in Control.Lens.Reified

type Rep (ReifiedIndexedGetter i) Source # 
Instance details

Defined in Control.Lens.Reified

newtype ReifiedFold s a Source #

Reify a Fold so it can be stored safely in a container.

This can also be useful for creatively combining folds as ReifiedFold s is isomorphic to ReaderT s [] and provides similar instances.

>>> ("hello","world")^..runFold ((,) <$> Fold _2 <*> Fold both)
[("world","hello"),("world","world")]

Constructors

Fold 

Fields

Instances

Instances details
Arrow ReifiedFold Source # 
Instance details

Defined in Control.Lens.Reified

Methods

arr :: (b -> c) -> ReifiedFold b c #

first :: ReifiedFold b c -> ReifiedFold (b, d) (c, d) #

second :: ReifiedFold b c -> ReifiedFold (d, b) (d, c) #

(***) :: ReifiedFold b c -> ReifiedFold b' c' -> ReifiedFold (b, b') (c, c') #

(&&&) :: ReifiedFold b c -> ReifiedFold b c' -> ReifiedFold b (c, c') #

ArrowApply ReifiedFold Source # 
Instance details

Defined in Control.Lens.Reified

Methods

app :: ReifiedFold (ReifiedFold b c, b) c #

ArrowChoice ReifiedFold Source # 
Instance details

Defined in Control.Lens.Reified

Methods

left :: ReifiedFold b c -> ReifiedFold (Either b d) (Either c d) #

right :: ReifiedFold b c -> ReifiedFold (Either d b) (Either d c) #

(+++) :: ReifiedFold b c -> ReifiedFold b' c' -> ReifiedFold (Either b b') (Either c c') #

(|||) :: ReifiedFold b d -> ReifiedFold c d -> ReifiedFold (Either b c) d #

Choice ReifiedFold Source # 
Instance details

Defined in Control.Lens.Reified

Methods

left' :: ReifiedFold a b -> ReifiedFold (Either a c) (Either b c) #

right' :: ReifiedFold a b -> ReifiedFold (Either c a) (Either c b) #

Representable ReifiedFold Source # 
Instance details

Defined in Control.Lens.Reified

Associated Types

type Rep ReifiedFold :: Type -> Type #

Methods

tabulate :: (d -> Rep ReifiedFold c) -> ReifiedFold d c #

Strong ReifiedFold Source # 
Instance details

Defined in Control.Lens.Reified

Methods

first' :: ReifiedFold a b -> ReifiedFold (a, c) (b, c) #

second' :: ReifiedFold a b -> ReifiedFold (c, a) (c, b) #

Profunctor ReifiedFold Source # 
Instance details

Defined in Control.Lens.Reified

Methods

dimap :: (a -> b) -> (c -> d) -> ReifiedFold b c -> ReifiedFold a d #

lmap :: (a -> b) -> ReifiedFold b c -> ReifiedFold a c #

rmap :: (b -> c) -> ReifiedFold a b -> ReifiedFold a c #

(#.) :: forall a b c q. Coercible c b => q b c -> ReifiedFold a b -> ReifiedFold a c #

(.#) :: forall a b c q. Coercible b a => ReifiedFold b c -> q a b -> ReifiedFold a c #

Category ReifiedFold Source # 
Instance details

Defined in Control.Lens.Reified

Methods

id :: forall (a :: k). ReifiedFold a a #

(.) :: forall (b :: k) (c :: k) (a :: k). ReifiedFold b c -> ReifiedFold a b -> ReifiedFold a c #

Sieve ReifiedFold List Source # 
Instance details

Defined in Control.Lens.Reified

Methods

sieve :: ReifiedFold a b -> a -> [b] #

MonadReader s (ReifiedFold s) Source # 
Instance details

Defined in Control.Lens.Reified

Methods

ask :: ReifiedFold s s #

local :: (s -> s) -> ReifiedFold s a -> ReifiedFold s a #

reader :: (s -> a) -> ReifiedFold s a #

Alternative (ReifiedFold s) Source # 
Instance details

Defined in Control.Lens.Reified

Methods

empty :: ReifiedFold s a #

(<|>) :: ReifiedFold s a -> ReifiedFold s a -> ReifiedFold s a #

some :: ReifiedFold s a -> ReifiedFold s [a] #

many :: ReifiedFold s a -> ReifiedFold s [a] #

Applicative (ReifiedFold s) Source # 
Instance details

Defined in Control.Lens.Reified

Methods

pure :: a -> ReifiedFold s a #

(<*>) :: ReifiedFold s (a -> b) -> ReifiedFold s a -> ReifiedFold s b #

liftA2 :: (a -> b -> c) -> ReifiedFold s a -> ReifiedFold s b -> ReifiedFold s c #

(*>) :: ReifiedFold s a -> ReifiedFold s b -> ReifiedFold s b #

(<*) :: ReifiedFold s a -> ReifiedFold s b -> ReifiedFold s a #

Functor (ReifiedFold s) Source # 
Instance details

Defined in Control.Lens.Reified

Methods

fmap :: (a -> b) -> ReifiedFold s a -> ReifiedFold s b #

(<$) :: a -> ReifiedFold s b -> ReifiedFold s a #

Monad (ReifiedFold s) Source # 
Instance details

Defined in Control.Lens.Reified

Methods

(>>=) :: ReifiedFold s a -> (a -> ReifiedFold s b) -> ReifiedFold s b #

(>>) :: ReifiedFold s a -> ReifiedFold s b -> ReifiedFold s b #

return :: a -> ReifiedFold s a #

MonadPlus (ReifiedFold s) Source # 
Instance details

Defined in Control.Lens.Reified

Methods

mzero :: ReifiedFold s a #

mplus :: ReifiedFold s a -> ReifiedFold s a -> ReifiedFold s a #

Alt (ReifiedFold s) Source # 
Instance details

Defined in Control.Lens.Reified

Apply (ReifiedFold s) Source # 
Instance details

Defined in Control.Lens.Reified

Methods

(<.>) :: ReifiedFold s (a -> b) -> ReifiedFold s a -> ReifiedFold s b #

(.>) :: ReifiedFold s a -> ReifiedFold s b -> ReifiedFold s b #

(<.) :: ReifiedFold s a -> ReifiedFold s b -> ReifiedFold s a #

liftF2 :: (a -> b -> c) -> ReifiedFold s a -> ReifiedFold s b -> ReifiedFold s c #

Bind (ReifiedFold s) Source # 
Instance details

Defined in Control.Lens.Reified

Methods

(>>-) :: ReifiedFold s a -> (a -> ReifiedFold s b) -> ReifiedFold s b #

join :: ReifiedFold s (ReifiedFold s a) -> ReifiedFold s a #

Plus (ReifiedFold s) Source # 
Instance details

Defined in Control.Lens.Reified

Methods

zero :: ReifiedFold s a #

Monoid (ReifiedFold s a) Source # 
Instance details

Defined in Control.Lens.Reified

Methods

mempty :: ReifiedFold s a #

mappend :: ReifiedFold s a -> ReifiedFold s a -> ReifiedFold s a #

mconcat :: [ReifiedFold s a] -> ReifiedFold s a #

Semigroup (ReifiedFold s a) Source # 
Instance details

Defined in Control.Lens.Reified

Methods

(<>) :: ReifiedFold s a -> ReifiedFold s a -> ReifiedFold s a #

sconcat :: NonEmpty (ReifiedFold s a) -> ReifiedFold s a #

stimes :: Integral b => b -> ReifiedFold s a -> ReifiedFold s a #

type Rep ReifiedFold Source # 
Instance details

Defined in Control.Lens.Reified

newtype ReifiedIndexedFold i s a Source #

Constructors

IndexedFold 

Fields

Instances

Instances details
Representable (ReifiedIndexedFold i) Source # 
Instance details

Defined in Control.Lens.Reified

Associated Types

type Rep (ReifiedIndexedFold i) :: Type -> Type #

Methods

tabulate :: (d -> Rep (ReifiedIndexedFold i) c) -> ReifiedIndexedFold i d c #

Strong (ReifiedIndexedFold i) Source # 
Instance details

Defined in Control.Lens.Reified

Methods

first' :: ReifiedIndexedFold i a b -> ReifiedIndexedFold i (a, c) (b, c) #

second' :: ReifiedIndexedFold i a b -> ReifiedIndexedFold i (c, a) (c, b) #

Profunctor (ReifiedIndexedFold i) Source # 
Instance details

Defined in Control.Lens.Reified

Methods

dimap :: (a -> b) -> (c -> d) -> ReifiedIndexedFold i b c -> ReifiedIndexedFold i a d #

lmap :: (a -> b) -> ReifiedIndexedFold i b c -> ReifiedIndexedFold i a c #

rmap :: (b -> c) -> ReifiedIndexedFold i a b -> ReifiedIndexedFold i a c #

(#.) :: forall a b c q. Coercible c b => q b c -> ReifiedIndexedFold i a b -> ReifiedIndexedFold i a c #

(.#) :: forall a b c q. Coercible b a => ReifiedIndexedFold i b c -> q a b -> ReifiedIndexedFold i a c #

Sieve (ReifiedIndexedFold i) (Compose List ((,) i)) Source # 
Instance details

Defined in Control.Lens.Reified

Methods

sieve :: ReifiedIndexedFold i a b -> a -> Compose List ((,) i) b #

Functor (ReifiedIndexedFold i s) Source # 
Instance details

Defined in Control.Lens.Reified

Methods

fmap :: (a -> b) -> ReifiedIndexedFold i s a -> ReifiedIndexedFold i s b #

(<$) :: a -> ReifiedIndexedFold i s b -> ReifiedIndexedFold i s a #

Alt (ReifiedIndexedFold i s) Source # 
Instance details

Defined in Control.Lens.Reified

Plus (ReifiedIndexedFold i s) Source # 
Instance details

Defined in Control.Lens.Reified

Methods

zero :: ReifiedIndexedFold i s a #

Monoid (ReifiedIndexedFold i s a) Source # 
Instance details

Defined in Control.Lens.Reified

Semigroup (ReifiedIndexedFold i s a) Source # 
Instance details

Defined in Control.Lens.Reified

type Rep (ReifiedIndexedFold i) Source # 
Instance details

Defined in Control.Lens.Reified

newtype ReifiedSetter s t a b Source #

Reify a Setter so it can be stored safely in a container.

Constructors

Setter 

Fields

newtype ReifiedIndexedSetter i s t a b Source #

Reify an IndexedSetter so it can be stored safely in a container.

Constructors

IndexedSetter 

Fields

newtype ReifiedIso s t a b Source #

Reify an Iso so it can be stored safely in a container.

Constructors

Iso 

Fields

newtype ReifiedPrism s t a b Source #

Reify a Prism so it can be stored safely in a container.

Constructors

Prism 

Fields