lens-4.19.2: 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
LanguageHaskell2010

Control.Lens.Reified

Description

 
Synopsis

Documentation

>>> import Control.Lens

newtype ReifiedLens s t a b Source #

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

Constructors

Lens 

Fields

newtype ReifiedIndexedLens i s t a b Source #

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

Constructors

IndexedLens 

Fields

newtype ReifiedIndexedTraversal i s t a b Source #

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

Constructors

IndexedTraversal 

newtype ReifiedTraversal s t a b Source #

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

Constructors

Traversal 

Fields

newtype ReifiedGetter s a Source #

Reify a ReifiedGetter 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
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') #

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 #

ArrowApply ReifiedGetter Source # 
Instance details

Defined in Control.Lens.Reified

Methods

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

ArrowLoop ReifiedGetter Source # 
Instance details

Defined in Control.Lens.Reified

Methods

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

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 #

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

(.#) :: Coercible b a => ReifiedGetter b c -> q a b -> ReifiedGetter a 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 #

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 #

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) #

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) #

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 #

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 #

Sieve ReifiedGetter Identity Source # 
Instance details

Defined in Control.Lens.Reified

Methods

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

Cosieve ReifiedGetter Identity Source # 
Instance details

Defined in Control.Lens.Reified

Methods

cosieve :: ReifiedGetter a b -> Identity a -> 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 #

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 #

fail :: String -> 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 #

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 #

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) #

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 #

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

Category ReifiedGetter Source # 
Instance details

Defined in Control.Lens.Reified

Methods

id :: ReifiedGetter a a #

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

type Rep ReifiedGetter Source # 
Instance details

Defined in Control.Lens.Reified

type Corep ReifiedGetter Source # 
Instance details

Defined in Control.Lens.Reified

newtype ReifiedIndexedGetter i s a Source #

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

Constructors

IndexedGetter 
Instances
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 #

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

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

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) #

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 ReifiedFold 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
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') #

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 #

ArrowApply ReifiedFold Source # 
Instance details

Defined in Control.Lens.Reified

Methods

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

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 #

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

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

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 #

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) #

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) #

Sieve ReifiedFold [] 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 #

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 #

fail :: String -> 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 #

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 #

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] #

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 #

Plus (ReifiedFold s) Source # 
Instance details

Defined in Control.Lens.Reified

Methods

zero :: 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 #

Category ReifiedFold Source # 
Instance details

Defined in Control.Lens.Reified

Methods

id :: ReifiedFold a a #

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

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 #

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 #

type Rep ReifiedFold Source # 
Instance details

Defined in Control.Lens.Reified

type Rep ReifiedFold = []

newtype ReifiedIndexedFold i s a Source #

Constructors

IndexedFold 

Fields

Instances
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 #

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

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

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) #

Sieve (ReifiedIndexedFold i) (Compose [] ((,) i)) Source # 
Instance details

Defined in Control.Lens.Reified

Methods

sieve :: ReifiedIndexedFold i a b -> a -> Compose [] ((,) 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 #

Plus (ReifiedIndexedFold i s) Source # 
Instance details

Defined in Control.Lens.Reified

Methods

zero :: ReifiedIndexedFold i s a #

Alt (ReifiedIndexedFold i s) Source # 
Instance details

Defined in Control.Lens.Reified

Semigroup (ReifiedIndexedFold i s a) Source # 
Instance details

Defined in Control.Lens.Reified

Monoid (ReifiedIndexedFold i s a) Source # 
Instance details

Defined in Control.Lens.Reified

type Rep (ReifiedIndexedFold i) Source # 
Instance details

Defined in Control.Lens.Reified

type Rep (ReifiedIndexedFold i) = Compose [] ((,) i)

newtype ReifiedSetter s t a b Source #

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

Constructors

Setter 

Fields

newtype ReifiedIndexedSetter i s t a b Source #

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

Constructors

IndexedSetter 

Fields

newtype ReifiedIso s t a b Source #

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

Constructors

Iso 

Fields

newtype ReifiedPrism s t a b Source #

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

Constructors

Prism 

Fields