Copyright | (C) 2012-16 Edward Kmett |
---|---|
License | BSD-style (see the file LICENSE) |
Maintainer | Edward Kmett <ekmett@gmail.com> |
Stability | provisional |
Portability | Rank2Types |
Safe Haskell | Safe-Inferred |
Language | Haskell2010 |
Synopsis
- newtype ReifiedLens s t a b = Lens {}
- type ReifiedLens' s a = ReifiedLens s s a a
- newtype ReifiedIndexedLens i s t a b = IndexedLens {
- runIndexedLens :: IndexedLens i s t a b
- type ReifiedIndexedLens' i s a = ReifiedIndexedLens i s s a a
- newtype ReifiedIndexedTraversal i s t a b = IndexedTraversal {
- runIndexedTraversal :: IndexedTraversal i s t a b
- type ReifiedIndexedTraversal' i s a = ReifiedIndexedTraversal i s s a a
- newtype ReifiedTraversal s t a b = Traversal {
- runTraversal :: Traversal s t a b
- type ReifiedTraversal' s a = ReifiedTraversal s s a a
- newtype ReifiedGetter s a = Getter {}
- newtype ReifiedIndexedGetter i s a = IndexedGetter {
- runIndexedGetter :: IndexedGetter i s a
- newtype ReifiedFold s a = Fold {}
- newtype ReifiedIndexedFold i s a = IndexedFold {
- runIndexedFold :: IndexedFold i s a
- newtype ReifiedSetter s t a b = Setter {}
- type ReifiedSetter' s a = ReifiedSetter s s a a
- newtype ReifiedIndexedSetter i s t a b = IndexedSetter {
- runIndexedSetter :: IndexedSetter i s t a b
- type ReifiedIndexedSetter' i s a = ReifiedIndexedSetter i s s a a
- newtype ReifiedIso s t a b = Iso {}
- type ReifiedIso' s a = ReifiedIso s s a a
- newtype ReifiedPrism s t a b = Prism {}
- type ReifiedPrism' s a = ReifiedPrism s s a a
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.
type ReifiedLens' s a = ReifiedLens s s a a Source #
typeReifiedLens'
=Simple
ReifiedLens
newtype ReifiedIndexedLens i s t a b Source #
Reify an IndexedLens
so it can be stored safely in a container.
IndexedLens | |
|
type ReifiedIndexedLens' i s a = ReifiedIndexedLens i s s a a Source #
typeReifiedIndexedLens'
i =Simple
(ReifiedIndexedLens
i)
newtype ReifiedIndexedTraversal i s t a b Source #
Reify an IndexedTraversal
so it can be stored safely in a container.
IndexedTraversal | |
|
type ReifiedIndexedTraversal' i s a = ReifiedIndexedTraversal i s s a a Source #
typeReifiedIndexedTraversal'
i =Simple
(ReifiedIndexedTraversal
i)
newtype ReifiedTraversal s t a b Source #
A form of Traversal
that can be stored monomorphically in a container.
Traversal | |
|
type ReifiedTraversal' s a = ReifiedTraversal s s a a Source #
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)
Instances
newtype ReifiedIndexedGetter i s a Source #
Reify an IndexedGetter
so it can be stored safely in a container.
IndexedGetter | |
|
Instances
Representable (ReifiedIndexedGetter i) Source # | |||||
Defined in Control.Lens.Reified
tabulate :: (d -> Rep (ReifiedIndexedGetter i) c) -> ReifiedIndexedGetter i d c # | |||||
Strong (ReifiedIndexedGetter i) Source # | |||||
Defined in Control.Lens.Reified 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 # | |||||
Defined in Control.Lens.Reified 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 # | |||||
Defined in Control.Lens.Reified sieve :: ReifiedIndexedGetter i a b -> a -> (i, b) # | |||||
Functor (ReifiedIndexedGetter i s) Source # | |||||
Defined in Control.Lens.Reified 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 # | |||||
Defined in Control.Lens.Reified (<.>) :: ReifiedIndexedGetter i s (a -> b) -> ReifiedIndexedGetter i s a -> ReifiedIndexedGetter i s b # (.>) :: ReifiedIndexedGetter i s a -> ReifiedIndexedGetter i s b -> ReifiedIndexedGetter i s b # (<.) :: ReifiedIndexedGetter i s a -> ReifiedIndexedGetter i s b -> ReifiedIndexedGetter i s a # liftF2 :: (a -> b -> c) -> ReifiedIndexedGetter i s a -> ReifiedIndexedGetter i s b -> ReifiedIndexedGetter i s c # | |||||
type Rep (ReifiedIndexedGetter i) Source # | |||||
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
is isomorphic to ReifiedFold
sReaderT s []
and provides similar
instances.
>>>
("hello","world")^..runFold ((,) <$> Fold _2 <*> Fold both)
[("world","hello"),("world","world")]
Instances
Arrow ReifiedFold Source # | |||||
Defined in Control.Lens.Reified 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 # | |||||
Defined in Control.Lens.Reified app :: ReifiedFold (ReifiedFold b c, b) c # | |||||
ArrowChoice ReifiedFold Source # | |||||
Defined in Control.Lens.Reified 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 # | |||||
Defined in Control.Lens.Reified 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 # | |||||
Defined in Control.Lens.Reified
tabulate :: (d -> Rep ReifiedFold c) -> ReifiedFold d c # | |||||
Strong ReifiedFold Source # | |||||
Defined in Control.Lens.Reified first' :: ReifiedFold a b -> ReifiedFold (a, c) (b, c) # second' :: ReifiedFold a b -> ReifiedFold (c, a) (c, b) # | |||||
Profunctor ReifiedFold Source # | |||||
Defined in Control.Lens.Reified 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 # | |||||
Defined in Control.Lens.Reified id :: ReifiedFold a a # (.) :: ReifiedFold b c -> ReifiedFold a b -> ReifiedFold a c # | |||||
Sieve ReifiedFold [] Source # | |||||
Defined in Control.Lens.Reified sieve :: ReifiedFold a b -> a -> [b] # | |||||
MonadReader s (ReifiedFold s) Source # | |||||
Defined in Control.Lens.Reified ask :: ReifiedFold s s # local :: (s -> s) -> ReifiedFold s a -> ReifiedFold s a # reader :: (s -> a) -> ReifiedFold s a # | |||||
Alternative (ReifiedFold s) Source # | |||||
Defined in Control.Lens.Reified 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 # | |||||
Defined in Control.Lens.Reified 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 # | |||||
Defined in Control.Lens.Reified fmap :: (a -> b) -> ReifiedFold s a -> ReifiedFold s b # (<$) :: a -> ReifiedFold s b -> ReifiedFold s a # | |||||
Monad (ReifiedFold s) Source # | |||||
Defined in Control.Lens.Reified (>>=) :: 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 # | |||||
Defined in Control.Lens.Reified mzero :: ReifiedFold s a # mplus :: ReifiedFold s a -> ReifiedFold s a -> ReifiedFold s a # | |||||
Alt (ReifiedFold s) Source # | |||||
Defined in Control.Lens.Reified (<!>) :: ReifiedFold s a -> ReifiedFold s a -> ReifiedFold s a # some :: Applicative (ReifiedFold s) => ReifiedFold s a -> ReifiedFold s [a] # many :: Applicative (ReifiedFold s) => ReifiedFold s a -> ReifiedFold s [a] # | |||||
Apply (ReifiedFold s) Source # | |||||
Defined in Control.Lens.Reified (<.>) :: 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 # | |||||
Defined in Control.Lens.Reified (>>-) :: ReifiedFold s a -> (a -> ReifiedFold s b) -> ReifiedFold s b # join :: ReifiedFold s (ReifiedFold s a) -> ReifiedFold s a # | |||||
Plus (ReifiedFold s) Source # | |||||
Defined in Control.Lens.Reified zero :: ReifiedFold s a # | |||||
Monoid (ReifiedFold s a) Source # | |||||
Defined in Control.Lens.Reified 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 # | |||||
Defined in Control.Lens.Reified (<>) :: 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 # | |||||
Defined in Control.Lens.Reified |
newtype ReifiedIndexedFold i s a Source #
IndexedFold | |
|
Instances
Representable (ReifiedIndexedFold i) Source # | |||||
Defined in Control.Lens.Reified
tabulate :: (d -> Rep (ReifiedIndexedFold i) c) -> ReifiedIndexedFold i d c # | |||||
Strong (ReifiedIndexedFold i) Source # | |||||
Defined in Control.Lens.Reified 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 # | |||||
Defined in Control.Lens.Reified 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 [] ((,) i)) Source # | |||||
Defined in Control.Lens.Reified | |||||
Functor (ReifiedIndexedFold i s) Source # | |||||
Defined in Control.Lens.Reified 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 # | |||||
Defined in Control.Lens.Reified (<!>) :: ReifiedIndexedFold i s a -> ReifiedIndexedFold i s a -> ReifiedIndexedFold i s a # some :: Applicative (ReifiedIndexedFold i s) => ReifiedIndexedFold i s a -> ReifiedIndexedFold i s [a] # many :: Applicative (ReifiedIndexedFold i s) => ReifiedIndexedFold i s a -> ReifiedIndexedFold i s [a] # | |||||
Plus (ReifiedIndexedFold i s) Source # | |||||
Defined in Control.Lens.Reified zero :: ReifiedIndexedFold i s a # | |||||
Monoid (ReifiedIndexedFold i s a) Source # | |||||
Defined in Control.Lens.Reified mempty :: ReifiedIndexedFold i s a # mappend :: ReifiedIndexedFold i s a -> ReifiedIndexedFold i s a -> ReifiedIndexedFold i s a # mconcat :: [ReifiedIndexedFold i s a] -> ReifiedIndexedFold i s a # | |||||
Semigroup (ReifiedIndexedFold i s a) Source # | |||||
Defined in Control.Lens.Reified (<>) :: ReifiedIndexedFold i s a -> ReifiedIndexedFold i s a -> ReifiedIndexedFold i s a # sconcat :: NonEmpty (ReifiedIndexedFold i s a) -> ReifiedIndexedFold i s a # stimes :: Integral b => b -> ReifiedIndexedFold i s a -> ReifiedIndexedFold i s a # | |||||
type Rep (ReifiedIndexedFold i) Source # | |||||
Defined in Control.Lens.Reified |
newtype ReifiedSetter s t a b Source #
Reify a Setter
so it can be stored safely in a container.
type ReifiedSetter' s a = ReifiedSetter s s a a Source #
typeReifiedSetter'
=Simple
ReifiedSetter
newtype ReifiedIndexedSetter i s t a b Source #
Reify an IndexedSetter
so it can be stored safely in a container.
IndexedSetter | |
|
type ReifiedIndexedSetter' i s a = ReifiedIndexedSetter i s s a a Source #
typeReifiedIndexedSetter'
i =Simple
(ReifiedIndexedSetter
i)
newtype ReifiedIso s t a b Source #
Reify an Iso
so it can be stored safely in a container.
type ReifiedIso' s a = ReifiedIso s s a a Source #
typeReifiedIso'
=Simple
ReifiedIso
newtype ReifiedPrism s t a b Source #
Reify a Prism
so it can be stored safely in a container.
type ReifiedPrism' s a = ReifiedPrism s s a a Source #
typeReifiedPrism'
=Simple
ReifiedPrism