polysemy-optics-0.1.0.2: Optics for Polysemy.
Safe HaskellNone
LanguageHaskell2010

Optics.Polysemy

Synopsis

Documentation

(&) :: a -> (a -> b) -> b infixl 1 #

& is a reverse application operator. This provides notational convenience. Its precedence is one higher than that of the forward application operator $, which allows & to be nested in $.

>>> 5 & (+1) & show
"6"

Since: base-4.8.0.0

(<&>) :: Functor f => f a -> (a -> b) -> f b infixl 1 #

Flipped version of <$>.

(<&>) = flip fmap

Examples

Expand

Apply (+1) to a list, a Just and a Right:

>>> Just 2 <&> (+1)
Just 3
>>> [1,2,3] <&> (+1)
[2,3,4]
>>> Right 3 <&> (+1)
Right 4

Since: base-4.11.0.0

itoList :: FoldableWithIndex i f => f a -> [(i, a)] #

Extract the key-value pairs from a structure.

When you don't need access to the indices in the result, then toList is more flexible in what it accepts.

toListmap snd . itoList

ifor_ :: (FoldableWithIndex i t, Applicative f) => t a -> (i -> a -> f b) -> f () #

Traverse elements with access to the index i, discarding the results (with the arguments flipped).

ifor_flip itraverse_

When you don't need access to the index then for_ is more flexible in what it accepts.

for_ a ≡ ifor_ a . const

itraverse_ :: (FoldableWithIndex i t, Applicative f) => (i -> a -> f b) -> t a -> f () #

Traverse elements with access to the index i, discarding the results.

When you don't need access to the index then traverse_ is more flexible in what it accepts.

traverse_ l = itraverse . const

ifor :: (TraversableWithIndex i t, Applicative f) => t a -> (i -> a -> f b) -> f (t b) #

Traverse with an index (and the arguments flipped).

for a ≡ ifor a . const
iforflip itraverse

class Functor f => FunctorWithIndex i (f :: Type -> Type) | f -> i where #

A Functor with an additional index.

Instances must satisfy a modified form of the Functor laws:

imap f . imap g ≡ imap (\i -> f i . g i)
imap (\_ a -> a) ≡ id

Minimal complete definition

Nothing

Methods

imap :: (i -> a -> b) -> f a -> f b #

Map with access to the index.

Instances

Instances details
FunctorWithIndex Int []

The position in the list is available as the index.

Instance details

Defined in WithIndex

Methods

imap :: (Int -> a -> b) -> [a] -> [b] #

FunctorWithIndex Int ZipList

Same instance as for [].

Instance details

Defined in WithIndex

Methods

imap :: (Int -> a -> b) -> ZipList a -> ZipList b #

FunctorWithIndex Int NonEmpty 
Instance details

Defined in WithIndex

Methods

imap :: (Int -> a -> b) -> NonEmpty a -> NonEmpty b #

FunctorWithIndex Int IntMap 
Instance details

Defined in WithIndex

Methods

imap :: (Int -> a -> b) -> IntMap a -> IntMap b #

FunctorWithIndex Int Seq

The position in the Seq is available as the index.

Instance details

Defined in WithIndex

Methods

imap :: (Int -> a -> b) -> Seq a -> Seq b #

FunctorWithIndex () Maybe 
Instance details

Defined in WithIndex

Methods

imap :: (() -> a -> b) -> Maybe a -> Maybe b #

FunctorWithIndex () Par1 
Instance details

Defined in WithIndex

Methods

imap :: (() -> a -> b) -> Par1 a -> Par1 b #

FunctorWithIndex () Identity 
Instance details

Defined in WithIndex

Methods

imap :: (() -> a -> b) -> Identity a -> Identity b #

FunctorWithIndex k (Map k) 
Instance details

Defined in WithIndex

Methods

imap :: (k -> a -> b) -> Map k a -> Map k b #

FunctorWithIndex k ((,) k) 
Instance details

Defined in WithIndex

Methods

imap :: (k -> a -> b) -> (k, a) -> (k, b) #

Ix i => FunctorWithIndex i (Array i) 
Instance details

Defined in WithIndex

Methods

imap :: (i -> a -> b) -> Array i a -> Array i b #

FunctorWithIndex Void (V1 :: Type -> Type) 
Instance details

Defined in WithIndex

Methods

imap :: (Void -> a -> b) -> V1 a -> V1 b #

FunctorWithIndex Void (U1 :: Type -> Type) 
Instance details

Defined in WithIndex

Methods

imap :: (Void -> a -> b) -> U1 a -> U1 b #

FunctorWithIndex Void (Proxy :: Type -> Type) 
Instance details

Defined in WithIndex

Methods

imap :: (Void -> a -> b) -> Proxy a -> Proxy b #

FunctorWithIndex i f => FunctorWithIndex i (Reverse f) 
Instance details

Defined in WithIndex

Methods

imap :: (i -> a -> b) -> Reverse f a -> Reverse f b #

FunctorWithIndex i f => FunctorWithIndex i (Rec1 f) 
Instance details

Defined in WithIndex

Methods

imap :: (i -> a -> b) -> Rec1 f a -> Rec1 f b #

FunctorWithIndex i m => FunctorWithIndex i (IdentityT m) 
Instance details

Defined in WithIndex

Methods

imap :: (i -> a -> b) -> IdentityT m a -> IdentityT m b #

FunctorWithIndex i f => FunctorWithIndex i (Backwards f) 
Instance details

Defined in WithIndex

Methods

imap :: (i -> a -> b) -> Backwards f a -> Backwards f b #

FunctorWithIndex Void (Const e :: Type -> Type) 
Instance details

Defined in WithIndex

Methods

imap :: (Void -> a -> b) -> Const e a -> Const e b #

FunctorWithIndex Void (Constant e :: Type -> Type) 
Instance details

Defined in WithIndex

Methods

imap :: (Void -> a -> b) -> Constant e a -> Constant e b #

FunctorWithIndex r ((->) r :: Type -> Type) 
Instance details

Defined in WithIndex

Methods

imap :: (r -> a -> b) -> (r -> a) -> r -> b #

FunctorWithIndex Void (K1 i c :: Type -> Type) 
Instance details

Defined in WithIndex

Methods

imap :: (Void -> a -> b) -> K1 i c a -> K1 i c b #

FunctorWithIndex [Int] Tree 
Instance details

Defined in WithIndex

Methods

imap :: ([Int] -> a -> b) -> Tree a -> Tree b #

FunctorWithIndex i m => FunctorWithIndex (e, i) (ReaderT e m) 
Instance details

Defined in WithIndex

Methods

imap :: ((e, i) -> a -> b) -> ReaderT e m a -> ReaderT e m b #

(FunctorWithIndex i f, FunctorWithIndex j g) => FunctorWithIndex (Either i j) (Sum f g) 
Instance details

Defined in WithIndex

Methods

imap :: (Either i j -> a -> b) -> Sum f g a -> Sum f g b #

(FunctorWithIndex i f, FunctorWithIndex j g) => FunctorWithIndex (Either i j) (Product f g) 
Instance details

Defined in WithIndex

Methods

imap :: (Either i j -> a -> b) -> Product f g a -> Product f g b #

(FunctorWithIndex i f, FunctorWithIndex j g) => FunctorWithIndex (Either i j) (f :+: g) 
Instance details

Defined in WithIndex

Methods

imap :: (Either i j -> a -> b) -> (f :+: g) a -> (f :+: g) b #

(FunctorWithIndex i f, FunctorWithIndex j g) => FunctorWithIndex (Either i j) (f :*: g) 
Instance details

Defined in WithIndex

Methods

imap :: (Either i j -> a -> b) -> (f :*: g) a -> (f :*: g) b #

(FunctorWithIndex i f, FunctorWithIndex j g) => FunctorWithIndex (i, j) (Compose f g) 
Instance details

Defined in WithIndex

Methods

imap :: ((i, j) -> a -> b) -> Compose f g a -> Compose f g b #

(FunctorWithIndex i f, FunctorWithIndex j g) => FunctorWithIndex (i, j) (f :.: g) 
Instance details

Defined in WithIndex

Methods

imap :: ((i, j) -> a -> b) -> (f :.: g) a -> (f :.: g) b #

class Foldable f => FoldableWithIndex i (f :: Type -> Type) | f -> i where #

A container that supports folding with an additional index.

Minimal complete definition

Nothing

Methods

ifoldMap :: Monoid m => (i -> a -> m) -> f a -> m #

Fold a container by mapping value to an arbitrary Monoid with access to the index i.

When you don't need access to the index then foldMap is more flexible in what it accepts.

foldMapifoldMap . const

ifoldMap' :: Monoid m => (i -> a -> m) -> f a -> m #

A variant of ifoldMap that is strict in the accumulator.

When you don't need access to the index then foldMap' is more flexible in what it accepts.

foldMap'ifoldMap' . const

ifoldr :: (i -> a -> b -> b) -> b -> f a -> b #

Right-associative fold of an indexed container with access to the index i.

When you don't need access to the index then foldr is more flexible in what it accepts.

foldrifoldr . const

ifoldl :: (i -> b -> a -> b) -> b -> f a -> b #

Left-associative fold of an indexed container with access to the index i.

When you don't need access to the index then foldl is more flexible in what it accepts.

foldlifoldl . const

ifoldr' :: (i -> a -> b -> b) -> b -> f a -> b #

Strictly fold right over the elements of a structure with access to the index i.

When you don't need access to the index then foldr' is more flexible in what it accepts.

foldr'ifoldr' . const

ifoldl' :: (i -> b -> a -> b) -> b -> f a -> b #

Fold over the elements of a structure with an index, associating to the left, but strictly.

When you don't need access to the index then foldlOf' is more flexible in what it accepts.

foldl' l ≡ ifoldl' l . const

Instances

Instances details
FoldableWithIndex Int [] 
Instance details

Defined in WithIndex

Methods

ifoldMap :: Monoid m => (Int -> a -> m) -> [a] -> m #

ifoldMap' :: Monoid m => (Int -> a -> m) -> [a] -> m #

ifoldr :: (Int -> a -> b -> b) -> b -> [a] -> b #

ifoldl :: (Int -> b -> a -> b) -> b -> [a] -> b #

ifoldr' :: (Int -> a -> b -> b) -> b -> [a] -> b #

ifoldl' :: (Int -> b -> a -> b) -> b -> [a] -> b #

FoldableWithIndex Int ZipList 
Instance details

Defined in WithIndex

Methods

ifoldMap :: Monoid m => (Int -> a -> m) -> ZipList a -> m #

ifoldMap' :: Monoid m => (Int -> a -> m) -> ZipList a -> m #

ifoldr :: (Int -> a -> b -> b) -> b -> ZipList a -> b #

ifoldl :: (Int -> b -> a -> b) -> b -> ZipList a -> b #

ifoldr' :: (Int -> a -> b -> b) -> b -> ZipList a -> b #

ifoldl' :: (Int -> b -> a -> b) -> b -> ZipList a -> b #

FoldableWithIndex Int NonEmpty 
Instance details

Defined in WithIndex

Methods

ifoldMap :: Monoid m => (Int -> a -> m) -> NonEmpty a -> m #

ifoldMap' :: Monoid m => (Int -> a -> m) -> NonEmpty a -> m #

ifoldr :: (Int -> a -> b -> b) -> b -> NonEmpty a -> b #

ifoldl :: (Int -> b -> a -> b) -> b -> NonEmpty a -> b #

ifoldr' :: (Int -> a -> b -> b) -> b -> NonEmpty a -> b #

ifoldl' :: (Int -> b -> a -> b) -> b -> NonEmpty a -> b #

FoldableWithIndex Int IntMap 
Instance details

Defined in WithIndex

Methods

ifoldMap :: Monoid m => (Int -> a -> m) -> IntMap a -> m #

ifoldMap' :: Monoid m => (Int -> a -> m) -> IntMap a -> m #

ifoldr :: (Int -> a -> b -> b) -> b -> IntMap a -> b #

ifoldl :: (Int -> b -> a -> b) -> b -> IntMap a -> b #

ifoldr' :: (Int -> a -> b -> b) -> b -> IntMap a -> b #

ifoldl' :: (Int -> b -> a -> b) -> b -> IntMap a -> b #

FoldableWithIndex Int Seq 
Instance details

Defined in WithIndex

Methods

ifoldMap :: Monoid m => (Int -> a -> m) -> Seq a -> m #

ifoldMap' :: Monoid m => (Int -> a -> m) -> Seq a -> m #

ifoldr :: (Int -> a -> b -> b) -> b -> Seq a -> b #

ifoldl :: (Int -> b -> a -> b) -> b -> Seq a -> b #

ifoldr' :: (Int -> a -> b -> b) -> b -> Seq a -> b #

ifoldl' :: (Int -> b -> a -> b) -> b -> Seq a -> b #

FoldableWithIndex () Maybe 
Instance details

Defined in WithIndex

Methods

ifoldMap :: Monoid m => (() -> a -> m) -> Maybe a -> m #

ifoldMap' :: Monoid m => (() -> a -> m) -> Maybe a -> m #

ifoldr :: (() -> a -> b -> b) -> b -> Maybe a -> b #

ifoldl :: (() -> b -> a -> b) -> b -> Maybe a -> b #

ifoldr' :: (() -> a -> b -> b) -> b -> Maybe a -> b #

ifoldl' :: (() -> b -> a -> b) -> b -> Maybe a -> b #

FoldableWithIndex () Par1 
Instance details

Defined in WithIndex

Methods

ifoldMap :: Monoid m => (() -> a -> m) -> Par1 a -> m #

ifoldMap' :: Monoid m => (() -> a -> m) -> Par1 a -> m #

ifoldr :: (() -> a -> b -> b) -> b -> Par1 a -> b #

ifoldl :: (() -> b -> a -> b) -> b -> Par1 a -> b #

ifoldr' :: (() -> a -> b -> b) -> b -> Par1 a -> b #

ifoldl' :: (() -> b -> a -> b) -> b -> Par1 a -> b #

FoldableWithIndex () Identity 
Instance details

Defined in WithIndex

Methods

ifoldMap :: Monoid m => (() -> a -> m) -> Identity a -> m #

ifoldMap' :: Monoid m => (() -> a -> m) -> Identity a -> m #

ifoldr :: (() -> a -> b -> b) -> b -> Identity a -> b #

ifoldl :: (() -> b -> a -> b) -> b -> Identity a -> b #

ifoldr' :: (() -> a -> b -> b) -> b -> Identity a -> b #

ifoldl' :: (() -> b -> a -> b) -> b -> Identity a -> b #

FoldableWithIndex k (Map k) 
Instance details

Defined in WithIndex

Methods

ifoldMap :: Monoid m => (k -> a -> m) -> Map k a -> m #

ifoldMap' :: Monoid m => (k -> a -> m) -> Map k a -> m #

ifoldr :: (k -> a -> b -> b) -> b -> Map k a -> b #

ifoldl :: (k -> b -> a -> b) -> b -> Map k a -> b #

ifoldr' :: (k -> a -> b -> b) -> b -> Map k a -> b #

ifoldl' :: (k -> b -> a -> b) -> b -> Map k a -> b #

FoldableWithIndex k ((,) k) 
Instance details

Defined in WithIndex

Methods

ifoldMap :: Monoid m => (k -> a -> m) -> (k, a) -> m #

ifoldMap' :: Monoid m => (k -> a -> m) -> (k, a) -> m #

ifoldr :: (k -> a -> b -> b) -> b -> (k, a) -> b #

ifoldl :: (k -> b -> a -> b) -> b -> (k, a) -> b #

ifoldr' :: (k -> a -> b -> b) -> b -> (k, a) -> b #

ifoldl' :: (k -> b -> a -> b) -> b -> (k, a) -> b #

Ix i => FoldableWithIndex i (Array i) 
Instance details

Defined in WithIndex

Methods

ifoldMap :: Monoid m => (i -> a -> m) -> Array i a -> m #

ifoldMap' :: Monoid m => (i -> a -> m) -> Array i a -> m #

ifoldr :: (i -> a -> b -> b) -> b -> Array i a -> b #

ifoldl :: (i -> b -> a -> b) -> b -> Array i a -> b #

ifoldr' :: (i -> a -> b -> b) -> b -> Array i a -> b #

ifoldl' :: (i -> b -> a -> b) -> b -> Array i a -> b #

FoldableWithIndex Void (V1 :: Type -> Type) 
Instance details

Defined in WithIndex

Methods

ifoldMap :: Monoid m => (Void -> a -> m) -> V1 a -> m #

ifoldMap' :: Monoid m => (Void -> a -> m) -> V1 a -> m #

ifoldr :: (Void -> a -> b -> b) -> b -> V1 a -> b #

ifoldl :: (Void -> b -> a -> b) -> b -> V1 a -> b #

ifoldr' :: (Void -> a -> b -> b) -> b -> V1 a -> b #

ifoldl' :: (Void -> b -> a -> b) -> b -> V1 a -> b #

FoldableWithIndex Void (U1 :: Type -> Type) 
Instance details

Defined in WithIndex

Methods

ifoldMap :: Monoid m => (Void -> a -> m) -> U1 a -> m #

ifoldMap' :: Monoid m => (Void -> a -> m) -> U1 a -> m #

ifoldr :: (Void -> a -> b -> b) -> b -> U1 a -> b #

ifoldl :: (Void -> b -> a -> b) -> b -> U1 a -> b #

ifoldr' :: (Void -> a -> b -> b) -> b -> U1 a -> b #

ifoldl' :: (Void -> b -> a -> b) -> b -> U1 a -> b #

FoldableWithIndex Void (Proxy :: Type -> Type) 
Instance details

Defined in WithIndex

Methods

ifoldMap :: Monoid m => (Void -> a -> m) -> Proxy a -> m #

ifoldMap' :: Monoid m => (Void -> a -> m) -> Proxy a -> m #

ifoldr :: (Void -> a -> b -> b) -> b -> Proxy a -> b #

ifoldl :: (Void -> b -> a -> b) -> b -> Proxy a -> b #

ifoldr' :: (Void -> a -> b -> b) -> b -> Proxy a -> b #

ifoldl' :: (Void -> b -> a -> b) -> b -> Proxy a -> b #

FoldableWithIndex i f => FoldableWithIndex i (Reverse f) 
Instance details

Defined in WithIndex

Methods

ifoldMap :: Monoid m => (i -> a -> m) -> Reverse f a -> m #

ifoldMap' :: Monoid m => (i -> a -> m) -> Reverse f a -> m #

ifoldr :: (i -> a -> b -> b) -> b -> Reverse f a -> b #

ifoldl :: (i -> b -> a -> b) -> b -> Reverse f a -> b #

ifoldr' :: (i -> a -> b -> b) -> b -> Reverse f a -> b #

ifoldl' :: (i -> b -> a -> b) -> b -> Reverse f a -> b #

FoldableWithIndex i f => FoldableWithIndex i (Rec1 f) 
Instance details

Defined in WithIndex

Methods

ifoldMap :: Monoid m => (i -> a -> m) -> Rec1 f a -> m #

ifoldMap' :: Monoid m => (i -> a -> m) -> Rec1 f a -> m #

ifoldr :: (i -> a -> b -> b) -> b -> Rec1 f a -> b #

ifoldl :: (i -> b -> a -> b) -> b -> Rec1 f a -> b #

ifoldr' :: (i -> a -> b -> b) -> b -> Rec1 f a -> b #

ifoldl' :: (i -> b -> a -> b) -> b -> Rec1 f a -> b #

FoldableWithIndex i m => FoldableWithIndex i (IdentityT m) 
Instance details

Defined in WithIndex

Methods

ifoldMap :: Monoid m0 => (i -> a -> m0) -> IdentityT m a -> m0 #

ifoldMap' :: Monoid m0 => (i -> a -> m0) -> IdentityT m a -> m0 #

ifoldr :: (i -> a -> b -> b) -> b -> IdentityT m a -> b #

ifoldl :: (i -> b -> a -> b) -> b -> IdentityT m a -> b #

ifoldr' :: (i -> a -> b -> b) -> b -> IdentityT m a -> b #

ifoldl' :: (i -> b -> a -> b) -> b -> IdentityT m a -> b #

FoldableWithIndex i f => FoldableWithIndex i (Backwards f) 
Instance details

Defined in WithIndex

Methods

ifoldMap :: Monoid m => (i -> a -> m) -> Backwards f a -> m #

ifoldMap' :: Monoid m => (i -> a -> m) -> Backwards f a -> m #

ifoldr :: (i -> a -> b -> b) -> b -> Backwards f a -> b #

ifoldl :: (i -> b -> a -> b) -> b -> Backwards f a -> b #

ifoldr' :: (i -> a -> b -> b) -> b -> Backwards f a -> b #

ifoldl' :: (i -> b -> a -> b) -> b -> Backwards f a -> b #

FoldableWithIndex Void (Const e :: Type -> Type) 
Instance details

Defined in WithIndex

Methods

ifoldMap :: Monoid m => (Void -> a -> m) -> Const e a -> m #

ifoldMap' :: Monoid m => (Void -> a -> m) -> Const e a -> m #

ifoldr :: (Void -> a -> b -> b) -> b -> Const e a -> b #

ifoldl :: (Void -> b -> a -> b) -> b -> Const e a -> b #

ifoldr' :: (Void -> a -> b -> b) -> b -> Const e a -> b #

ifoldl' :: (Void -> b -> a -> b) -> b -> Const e a -> b #

FoldableWithIndex Void (Constant e :: Type -> Type) 
Instance details

Defined in WithIndex

Methods

ifoldMap :: Monoid m => (Void -> a -> m) -> Constant e a -> m #

ifoldMap' :: Monoid m => (Void -> a -> m) -> Constant e a -> m #

ifoldr :: (Void -> a -> b -> b) -> b -> Constant e a -> b #

ifoldl :: (Void -> b -> a -> b) -> b -> Constant e a -> b #

ifoldr' :: (Void -> a -> b -> b) -> b -> Constant e a -> b #

ifoldl' :: (Void -> b -> a -> b) -> b -> Constant e a -> b #

FoldableWithIndex Void (K1 i c :: Type -> Type) 
Instance details

Defined in WithIndex

Methods

ifoldMap :: Monoid m => (Void -> a -> m) -> K1 i c a -> m #

ifoldMap' :: Monoid m => (Void -> a -> m) -> K1 i c a -> m #

ifoldr :: (Void -> a -> b -> b) -> b -> K1 i c a -> b #

ifoldl :: (Void -> b -> a -> b) -> b -> K1 i c a -> b #

ifoldr' :: (Void -> a -> b -> b) -> b -> K1 i c a -> b #

ifoldl' :: (Void -> b -> a -> b) -> b -> K1 i c a -> b #

FoldableWithIndex [Int] Tree 
Instance details

Defined in WithIndex

Methods

ifoldMap :: Monoid m => ([Int] -> a -> m) -> Tree a -> m #

ifoldMap' :: Monoid m => ([Int] -> a -> m) -> Tree a -> m #

ifoldr :: ([Int] -> a -> b -> b) -> b -> Tree a -> b #

ifoldl :: ([Int] -> b -> a -> b) -> b -> Tree a -> b #

ifoldr' :: ([Int] -> a -> b -> b) -> b -> Tree a -> b #

ifoldl' :: ([Int] -> b -> a -> b) -> b -> Tree a -> b #

(FoldableWithIndex i f, FoldableWithIndex j g) => FoldableWithIndex (Either i j) (Sum f g) 
Instance details

Defined in WithIndex

Methods

ifoldMap :: Monoid m => (Either i j -> a -> m) -> Sum f g a -> m #

ifoldMap' :: Monoid m => (Either i j -> a -> m) -> Sum f g a -> m #

ifoldr :: (Either i j -> a -> b -> b) -> b -> Sum f g a -> b #

ifoldl :: (Either i j -> b -> a -> b) -> b -> Sum f g a -> b #

ifoldr' :: (Either i j -> a -> b -> b) -> b -> Sum f g a -> b #

ifoldl' :: (Either i j -> b -> a -> b) -> b -> Sum f g a -> b #

(FoldableWithIndex i f, FoldableWithIndex j g) => FoldableWithIndex (Either i j) (Product f g) 
Instance details

Defined in WithIndex

Methods

ifoldMap :: Monoid m => (Either i j -> a -> m) -> Product f g a -> m #

ifoldMap' :: Monoid m => (Either i j -> a -> m) -> Product f g a -> m #

ifoldr :: (Either i j -> a -> b -> b) -> b -> Product f g a -> b #

ifoldl :: (Either i j -> b -> a -> b) -> b -> Product f g a -> b #

ifoldr' :: (Either i j -> a -> b -> b) -> b -> Product f g a -> b #

ifoldl' :: (Either i j -> b -> a -> b) -> b -> Product f g a -> b #

(FoldableWithIndex i f, FoldableWithIndex j g) => FoldableWithIndex (Either i j) (f :+: g) 
Instance details

Defined in WithIndex

Methods

ifoldMap :: Monoid m => (Either i j -> a -> m) -> (f :+: g) a -> m #

ifoldMap' :: Monoid m => (Either i j -> a -> m) -> (f :+: g) a -> m #

ifoldr :: (Either i j -> a -> b -> b) -> b -> (f :+: g) a -> b #

ifoldl :: (Either i j -> b -> a -> b) -> b -> (f :+: g) a -> b #

ifoldr' :: (Either i j -> a -> b -> b) -> b -> (f :+: g) a -> b #

ifoldl' :: (Either i j -> b -> a -> b) -> b -> (f :+: g) a -> b #

(FoldableWithIndex i f, FoldableWithIndex j g) => FoldableWithIndex (Either i j) (f :*: g) 
Instance details

Defined in WithIndex

Methods

ifoldMap :: Monoid m => (Either i j -> a -> m) -> (f :*: g) a -> m #

ifoldMap' :: Monoid m => (Either i j -> a -> m) -> (f :*: g) a -> m #

ifoldr :: (Either i j -> a -> b -> b) -> b -> (f :*: g) a -> b #

ifoldl :: (Either i j -> b -> a -> b) -> b -> (f :*: g) a -> b #

ifoldr' :: (Either i j -> a -> b -> b) -> b -> (f :*: g) a -> b #

ifoldl' :: (Either i j -> b -> a -> b) -> b -> (f :*: g) a -> b #

(FoldableWithIndex i f, FoldableWithIndex j g) => FoldableWithIndex (i, j) (Compose f g) 
Instance details

Defined in WithIndex

Methods

ifoldMap :: Monoid m => ((i, j) -> a -> m) -> Compose f g a -> m #

ifoldMap' :: Monoid m => ((i, j) -> a -> m) -> Compose f g a -> m #

ifoldr :: ((i, j) -> a -> b -> b) -> b -> Compose f g a -> b #

ifoldl :: ((i, j) -> b -> a -> b) -> b -> Compose f g a -> b #

ifoldr' :: ((i, j) -> a -> b -> b) -> b -> Compose f g a -> b #

ifoldl' :: ((i, j) -> b -> a -> b) -> b -> Compose f g a -> b #

(FoldableWithIndex i f, FoldableWithIndex j g) => FoldableWithIndex (i, j) (f :.: g) 
Instance details

Defined in WithIndex

Methods

ifoldMap :: Monoid m => ((i, j) -> a -> m) -> (f :.: g) a -> m #

ifoldMap' :: Monoid m => ((i, j) -> a -> m) -> (f :.: g) a -> m #

ifoldr :: ((i, j) -> a -> b -> b) -> b -> (f :.: g) a -> b #

ifoldl :: ((i, j) -> b -> a -> b) -> b -> (f :.: g) a -> b #

ifoldr' :: ((i, j) -> a -> b -> b) -> b -> (f :.: g) a -> b #

ifoldl' :: ((i, j) -> b -> a -> b) -> b -> (f :.: g) a -> b #

class (FunctorWithIndex i t, FoldableWithIndex i t, Traversable t) => TraversableWithIndex i (t :: Type -> Type) | t -> i where #

A Traversable with an additional index.

An instance must satisfy a (modified) form of the Traversable laws:

itraverse (const Identity) ≡ Identity
fmap (itraverse f) . itraverse g ≡ getCompose . itraverse (\i -> Compose . fmap (f i) . g i)

Minimal complete definition

Nothing

Methods

itraverse :: Applicative f => (i -> a -> f b) -> t a -> f (t b) #

Traverse an indexed container.

itraverseitraverseOf itraversed

Instances

Instances details
TraversableWithIndex Int [] 
Instance details

Defined in WithIndex

Methods

itraverse :: Applicative f => (Int -> a -> f b) -> [a] -> f [b] #

TraversableWithIndex Int ZipList 
Instance details

Defined in WithIndex

Methods

itraverse :: Applicative f => (Int -> a -> f b) -> ZipList a -> f (ZipList b) #

TraversableWithIndex Int NonEmpty 
Instance details

Defined in WithIndex

Methods

itraverse :: Applicative f => (Int -> a -> f b) -> NonEmpty a -> f (NonEmpty b) #

TraversableWithIndex Int IntMap 
Instance details

Defined in WithIndex

Methods

itraverse :: Applicative f => (Int -> a -> f b) -> IntMap a -> f (IntMap b) #

TraversableWithIndex Int Seq 
Instance details

Defined in WithIndex

Methods

itraverse :: Applicative f => (Int -> a -> f b) -> Seq a -> f (Seq b) #

TraversableWithIndex () Maybe 
Instance details

Defined in WithIndex

Methods

itraverse :: Applicative f => (() -> a -> f b) -> Maybe a -> f (Maybe b) #

TraversableWithIndex () Par1 
Instance details

Defined in WithIndex

Methods

itraverse :: Applicative f => (() -> a -> f b) -> Par1 a -> f (Par1 b) #

TraversableWithIndex () Identity 
Instance details

Defined in WithIndex

Methods

itraverse :: Applicative f => (() -> a -> f b) -> Identity a -> f (Identity b) #

TraversableWithIndex k (Map k) 
Instance details

Defined in WithIndex

Methods

itraverse :: Applicative f => (k -> a -> f b) -> Map k a -> f (Map k b) #

TraversableWithIndex k ((,) k) 
Instance details

Defined in WithIndex

Methods

itraverse :: Applicative f => (k -> a -> f b) -> (k, a) -> f (k, b) #

Ix i => TraversableWithIndex i (Array i) 
Instance details

Defined in WithIndex

Methods

itraverse :: Applicative f => (i -> a -> f b) -> Array i a -> f (Array i b) #

TraversableWithIndex Void (V1 :: Type -> Type) 
Instance details

Defined in WithIndex

Methods

itraverse :: Applicative f => (Void -> a -> f b) -> V1 a -> f (V1 b) #

TraversableWithIndex Void (U1 :: Type -> Type) 
Instance details

Defined in WithIndex

Methods

itraverse :: Applicative f => (Void -> a -> f b) -> U1 a -> f (U1 b) #

TraversableWithIndex Void (Proxy :: Type -> Type) 
Instance details

Defined in WithIndex

Methods

itraverse :: Applicative f => (Void -> a -> f b) -> Proxy a -> f (Proxy b) #

TraversableWithIndex i f => TraversableWithIndex i (Reverse f) 
Instance details

Defined in WithIndex

Methods

itraverse :: Applicative f0 => (i -> a -> f0 b) -> Reverse f a -> f0 (Reverse f b) #

TraversableWithIndex i f => TraversableWithIndex i (Rec1 f) 
Instance details

Defined in WithIndex

Methods

itraverse :: Applicative f0 => (i -> a -> f0 b) -> Rec1 f a -> f0 (Rec1 f b) #

TraversableWithIndex i m => TraversableWithIndex i (IdentityT m) 
Instance details

Defined in WithIndex

Methods

itraverse :: Applicative f => (i -> a -> f b) -> IdentityT m a -> f (IdentityT m b) #

TraversableWithIndex i f => TraversableWithIndex i (Backwards f) 
Instance details

Defined in WithIndex

Methods

itraverse :: Applicative f0 => (i -> a -> f0 b) -> Backwards f a -> f0 (Backwards f b) #

TraversableWithIndex Void (Const e :: Type -> Type) 
Instance details

Defined in WithIndex

Methods

itraverse :: Applicative f => (Void -> a -> f b) -> Const e a -> f (Const e b) #

TraversableWithIndex Void (Constant e :: Type -> Type) 
Instance details

Defined in WithIndex

Methods

itraverse :: Applicative f => (Void -> a -> f b) -> Constant e a -> f (Constant e b) #

TraversableWithIndex Void (K1 i c :: Type -> Type) 
Instance details

Defined in WithIndex

Methods

itraverse :: Applicative f => (Void -> a -> f b) -> K1 i c a -> f (K1 i c b) #

TraversableWithIndex [Int] Tree 
Instance details

Defined in WithIndex

Methods

itraverse :: Applicative f => ([Int] -> a -> f b) -> Tree a -> f (Tree b) #

(TraversableWithIndex i f, TraversableWithIndex j g) => TraversableWithIndex (Either i j) (Sum f g) 
Instance details

Defined in WithIndex

Methods

itraverse :: Applicative f0 => (Either i j -> a -> f0 b) -> Sum f g a -> f0 (Sum f g b) #

(TraversableWithIndex i f, TraversableWithIndex j g) => TraversableWithIndex (Either i j) (Product f g) 
Instance details

Defined in WithIndex

Methods

itraverse :: Applicative f0 => (Either i j -> a -> f0 b) -> Product f g a -> f0 (Product f g b) #

(TraversableWithIndex i f, TraversableWithIndex j g) => TraversableWithIndex (Either i j) (f :+: g) 
Instance details

Defined in WithIndex

Methods

itraverse :: Applicative f0 => (Either i j -> a -> f0 b) -> (f :+: g) a -> f0 ((f :+: g) b) #

(TraversableWithIndex i f, TraversableWithIndex j g) => TraversableWithIndex (Either i j) (f :*: g) 
Instance details

Defined in WithIndex

Methods

itraverse :: Applicative f0 => (Either i j -> a -> f0 b) -> (f :*: g) a -> f0 ((f :*: g) b) #

(TraversableWithIndex i f, TraversableWithIndex j g) => TraversableWithIndex (i, j) (Compose f g) 
Instance details

Defined in WithIndex

Methods

itraverse :: Applicative f0 => ((i, j) -> a -> f0 b) -> Compose f g a -> f0 (Compose f g b) #

(TraversableWithIndex i f, TraversableWithIndex j g) => TraversableWithIndex (i, j) (f :.: g) 
Instance details

Defined in WithIndex

Methods

itraverse :: Applicative f0 => ((i, j) -> a -> f0 b) -> (f :.: g) a -> f0 ((f :.: g) b) #

makePrisms #

Arguments

:: Name

Type constructor name

-> DecsQ 

Generate a Prism for each constructor of a data type. Isos generated when possible. Reviews are created for constructors with existentially quantified constructors and GADTs.

e.g.

data FooBarBaz a
  = Foo Int
  | Bar a
  | Baz Int Char
makePrisms ''FooBarBaz

will create

_Foo :: Prism' (FooBarBaz a) Int
_Bar :: Prism (FooBarBaz a) (FooBarBaz b) a b
_Baz :: Prism' (FooBarBaz a) (Int, Char)

makeClassyPrisms #

Arguments

:: Name

Type constructor name

-> DecsQ 

Generate a Prism for each constructor of a data type and combine them into a single class. No Isos are created. Reviews are created for constructors with existentially quantified constructors and GADTs.

e.g.

data FooBarBaz a
  = Foo Int
  | Bar a
  | Baz Int Char
makeClassyPrisms ''FooBarBaz

will create

class AsFooBarBaz s a | s -> a where
  _FooBarBaz :: Prism' s (FooBarBaz a)
  _Foo :: Prism' s Int
  _Bar :: Prism' s a
  _Baz :: Prism' s (Int,Char)

  _Foo = _FooBarBaz % _Foo
  _Bar = _FooBarBaz % _Bar
  _Baz = _FooBarBaz % _Baz

instance AsFooBarBaz (FooBarBaz a) a

Generate an As class of prisms. Names are selected by prefixing the constructor name with an underscore. Constructors with multiple fields will construct Prisms to tuples of those fields.

type ClassyNamer #

Arguments

 = Name

Name of the data type that lenses are being generated for.

-> Maybe (Name, Name)

Names of the class and the main method it generates, respectively.

The optional rule to create a class and method around a monomorphic data type. If this naming convention is provided, it generates a "classy" lens.

data DefName #

Name to give to generated field optics.

Constructors

TopName Name

Simple top-level definition name

MethodName Name Name

makeFields-style class name and method name

Instances

Instances details
Eq DefName 
Instance details

Defined in Optics.TH.Internal.Product

Methods

(==) :: DefName -> DefName -> Bool #

(/=) :: DefName -> DefName -> Bool #

Ord DefName 
Instance details

Defined in Optics.TH.Internal.Product

Show DefName 
Instance details

Defined in Optics.TH.Internal.Product

type FieldNamer #

Arguments

 = Name

Name of the data type that lenses are being generated for.

-> [Name]

Names of all fields (including the field being named) in the data type.

-> Name

Name of the field being named.

-> [DefName]

Name(s) of the lens functions. If empty, no lens is created for that field.

The rule to create function names of lenses for data fields.

Although it's sometimes useful, you won't need the first two arguments most of the time.

data LensRules #

Rules to construct lenses for data fields.

makeFieldLabelsWith :: LensRules -> Name -> DecsQ #

Build field optics as labels with a custom configuration.

makeFieldLabels :: Name -> DecsQ #

Build field optics as instances of the LabelOptic class for use with overloaded labels. See Optics.Label for how to use this pattern.

e.g.

data Animal
  = Cat { animalAge  :: Int
        , animalName :: String
        }
  | Dog { animalAge    :: Int
        , animalAbsurd :: forall a b. a -> b
        }
makeFieldLabels ''Animal

will create

instance
  (k ~ A_Lens, a ~ Int, b ~ Int
  ) => LabelOptic "age" k Animal Animal a b where
  labelOptic = lensVL $ \f s -> case s of
    Cat x1 x2 -> fmap (\y -> Cat y x2) (f x1)
    Dog x1 x2 -> fmap (\y -> Dog y x2) (f x1)

instance
  (k ~ An_AffineTraversal, a ~ String, b ~ String
  ) => LabelOptic "name" k Animal Animal a b where
  labelOptic = atraversalVL $ \point f s -> case s of
    Cat x1 x2 -> fmap (\y -> Cat x1 y) (f x2)
    Dog x1 x2 -> point (Dog x1 x2)

instance
  ( Dysfunctional "absurd" k Animal Animal a b
  , k ~ An_AffineFold, a ~ (x -> y), b ~ (x -> y)
  ) => LabelOptic "absurd" k Animal Animal a b where
  labelOptic = afolding $ \s -> case s of
    Cat _ _  -> Nothing
    Dog _ f  -> Just f

which can be used as #age, #name and #absurd with the OverloadedLabels language extension.

Note: if you wonder about the structure of instances, see Optics.Label.

makeFieldOptics = makeFieldLabelsWith fieldLabelsRules

makeFieldLabelsNoPrefix :: Name -> DecsQ #

An alias for makeFieldLabels noPrefixFieldLabels.

makeFieldLabelsFor :: [(String, String)] -> Name -> DecsQ #

Derive field optics as labels, specifying explicit pairings of (fieldName, labelName).

If you map multiple fields to the same label and it is present in the same constructor, Traversal (or Fold for a read only version) will be generated.

e.g.

makeFieldLabelsFor [("_foo", "fooLens"), ("baz", "lbaz")] ''Foo
makeFieldLabelsFor [("_barX", "bar"), ("_barY", "bar")] ''Bar

declareFieldLabels :: DecsQ -> DecsQ #

Make field optics as labels for all records in the given declaration quote. All record syntax in the input will be stripped off.

e.g.

declareLenses [d|
  data Dog = Dog { name :: String, age :: Int }
    deriving Show
  |]

will create

data Dog = Dog String Int
  deriving Show
instance (k ~ A_Lens, ...) => LabelOptic "name" k Dog Dog ...
instance (k ~ A_Lens, ...) => LabelOptic "age" k Dog Dog ...

declareFieldLabelsFor :: [(String, String)] -> DecsQ -> DecsQ #

Similar to makeFieldLabelsFor, but takes a declaration quote.

fieldLabelsRules :: LensRules #

Rules for generation of LabelOptic instances for use with OverloadedLabels. Same as lensRules, but uses camelCaseNamer.

Note: if you don't want to prefix field names with the full name of the data type, you can use abbreviatedNamer instead.

fieldLabelsRulesFor #

Arguments

:: [(String, String)]
(Field name, Label name)
-> LensRules 

Construct a LensRules value for generating LabelOptic instances using the given map from field names to definition names.

makeLenses :: Name -> DecsQ #

Build field optics as top level functions with a sensible default configuration.

e.g.

data Animal
  = Cat { _age  :: Int
        , _name :: String
        }
  | Dog { _age    :: Int
        , _absurd :: forall a b. a -> b
        }
makeLenses ''Animal

will create

absurd :: forall a b. AffineFold Animal (a -> b)
absurd = afolding $ \s -> case s of
  Cat _ _ -> Nothing
  Dog _ x -> Just x

age :: Lens' Animal Int
age = lensVL $ \f s -> case s of
  Cat x1 x2 -> fmap (\y -> Cat y x2) (f x1)
  Dog x1 x2 -> fmap (\y -> Dog y x2) (f x1)

name :: AffineTraversal' Animal String
name = atraversalVL $ \point f s -> case s of
  Cat x1 x2 -> fmap (\y -> Cat x1 y) (f x2)
  Dog x1 x2 -> point (Dog x1 x2)
makeLenses = makeLensesWith lensRules

makeLensesFor :: [(String, String)] -> Name -> DecsQ #

Derive field optics, specifying explicit pairings of (fieldName, opticName).

If you map multiple fields to the same optic and it is present in the same constructor, Traversal (or Fold for a read only version) will be generated.

e.g.

makeLensesFor [("_foo", "fooLens"), ("baz", "lbaz")] ''Foo
makeLensesFor [("_barX", "bar"), ("_barY", "bar")] ''Bar

makeLensesWith :: LensRules -> Name -> DecsQ #

Build field optics with a custom configuration.

declareLenses :: DecsQ -> DecsQ #

Make field optics for all records in the given declaration quote. All record syntax in the input will be stripped off.

e.g.

declareLenses [d|
  data Foo = Foo { fooX, fooY :: Int }
    deriving Show
  |]

will create

data Foo = Foo Int Int deriving Show
fooX, fooY :: Lens' Foo Int

declareLensesFor :: [(String, String)] -> DecsQ -> DecsQ #

Similar to makeLensesFor, but takes a declaration quote.

lensRules :: LensRules #

Rules for making read-write field optics as top-level functions. It uses underscoreNoPrefixNamer.

lensRulesFor #

Arguments

:: [(String, String)]
(Field name, Optic name)
-> LensRules 

Construct a LensRules value for generating top-level functions using the given map from field names to definition names.

makeClassy :: Name -> DecsQ #

Make lenses and traversals for a type, and create a class when the type has no arguments.

e.g.

data Foo = Foo { _fooX, _fooY :: Int }
makeClassy ''Foo

will create

class HasFoo c where
  foo  :: Lens' c Foo
  fooX :: Lens' c Int
  fooY :: Lens' c Int
  fooX = foo % fooX
  fooY = foo % fooY

instance HasFoo Foo where
  foo  = lensVL id
  fooX = lensVL $ \f s -> case s of
    Foo x1 x2 -> fmap (\y -> Foo y x2) (f x1)
  fooY = lensVL $ \f s -> case s of
    Foo x1 x2 -> fmap (\y -> Foo x1 y) (f x2)
makeClassy = makeLensesWith classyRules

makeClassy_ :: Name -> DecsQ #

Make lenses and traversals for a type, and create a class when the type has no arguments. Works the same as makeClassy except that (a) it expects that record field names do not begin with an underscore, (b) all record fields are made into lenses, and (c) the resulting lens is prefixed with an underscore.

makeClassyFor :: String -> String -> [(String, String)] -> Name -> DecsQ #

Derive lenses and traversals, using a named wrapper class, and specifying explicit pairings of (fieldName, traversalName).

Example usage:

makeClassyFor "HasFoo" "foo" [("_foo", "fooLens"), ("bar", "lbar")] ''Foo

declareClassy :: DecsQ -> DecsQ #

For each record in the declaration quote, make lenses and traversals for it, and create a class when the type has no arguments. All record syntax in the input will be stripped off.

e.g.

declareClassy [d|
  data Foo = Foo { fooX, fooY :: Int }
    deriving Show
  |]

will create

data Foo = Foo Int Int deriving Show
class HasFoo t where
  foo :: Lens' t Foo
instance HasFoo Foo where foo = id
fooX, fooY :: HasFoo t => Lens' t Int

declareClassyFor :: [(String, (String, String))] -> [(String, String)] -> DecsQ -> DecsQ #

Similar to makeClassyFor, but takes a declaration quote.

classyRules :: LensRules #

Rules for making lenses and traversals that precompose another Lens.

classyRulesFor #

Arguments

:: (String -> Maybe (String, String))

Type Name -> Maybe (Class Name, Method Name)

-> [(String, String)]
(Field Name, Method Name)
-> LensRules 

Rules for making lenses and traversals that precompose another Lens using a custom function for naming the class, main class method, and a mapping from field names to definition names.

makeFields :: Name -> DecsQ #

Generate overloaded field accessors.

e.g

data Foo a = Foo { _fooX :: Int, _fooY :: a }
newtype Bar = Bar { _barX :: Char }
makeFields ''Foo
makeFields ''Bar

will create

class HasX s a | s -> a where
  x :: Lens' s a

instance HasX (Foo a) Int where
  x = lensVL $ \f s -> case s of
    Foo x1 x2 -> fmap (\y -> Foo y x2) (f x1)

class HasY s a | s -> a where
  y :: Lens' s a

instance HasY (Foo a) a where
  y = lensVL $ \f s -> case s of
    Foo x1 x2 -> fmap (\y -> Foo x1 y) (f x2)

instance HasX Bar Char where
  x = lensVL $ \f s -> case s of
    Bar x1 -> fmap (\y -> Bar y) (f x1)

For details, see camelCaseFields.

makeFields = makeLensesWith defaultFieldRules

makeFieldsNoPrefix :: Name -> DecsQ #

Generate overloaded field accessors based on field names which are only prefixed with an underscore (e.g. _name), not additionally with the type name (e.g. _fooName).

This might be the desired behaviour in case the DuplicateRecordFields language extension is used in order to get rid of the necessity to prefix each field name with the type name.

As an example:

data Foo a  = Foo { _x :: Int, _y :: a }
newtype Bar = Bar { _x :: Char }
makeFieldsNoPrefix ''Foo
makeFieldsNoPrefix ''Bar

will create classes

class HasX s a | s -> a where
  x :: Lens' s a
class HasY s a | s -> a where
  y :: Lens' s a

together with instances

instance HasX (Foo a) Int
instance HasY (Foo a) a where
instance HasX Bar Char where

For details, see classUnderscoreNoPrefixFields.

makeFieldsNoPrefix = makeLensesWith classUnderscoreNoPrefixFields

declarePrisms :: DecsQ -> DecsQ #

Generate a Prism for each constructor of each data type.

e.g.

declarePrisms [d|
  data Exp = Lit Int | Var String | Lambda{ bound::String, body::Exp }
  |]

will create

data Exp = Lit Int | Var String | Lambda { bound::String, body::Exp }
_Lit :: Prism' Exp Int
_Var :: Prism' Exp String
_Lambda :: Prism' Exp (String, Exp)

simpleLenses :: Lens' LensRules Bool #

Generate "simple" optics even when type-changing optics are possible. (e.g. Lens' instead of Lens)

generateSignatures :: Lens' LensRules Bool #

Indicate whether or not to supply the signatures for the generated lenses.

Disabling this can be useful if you want to provide a more restricted type signature or if you want to supply hand-written haddocks.

generateUpdateableOptics :: Lens' LensRules Bool #

Generate "updateable" optics when True. When False, (affine) folds will be generated instead of (affine) traversals and getters will be generated instead of lenses. This mode is intended to be used for types with invariants which must be maintained by "smart" constructors.

generateLazyPatterns :: Lens' LensRules Bool #

Generate optics using lazy pattern matches. This can allow fields of an undefined value to be initialized with lenses:

data Foo = Foo {_x :: Int, _y :: Bool}
  deriving Show

makeLensesWith (lensRules & generateLazyPatterns .~ True) ''Foo
> undefined & x .~ 8 & y .~ True
Foo {_x = 8, _y = True}

The downside of this flag is that it can lead to space-leaks and code-size/compile-time increases when generated for large records. By default this flag is turned off, and strict optics are generated.

When using lazy optics the strict optic can be recovered by composing with equality':

strictOptic = equality' % lazyOptic

createClass :: Lens' LensRules Bool #

Create the class if the constructor if generated lenses would be type-preserving and the lensClass rule matches.

lensField :: Lens' LensRules FieldNamer #

Lens' to access the convention for naming fields in our LensRules.

lensClass :: Lens' LensRules ClassyNamer #

Lens' to access the option for naming "classy" lenses.

noPrefixFieldLabels :: LensRules #

Field rules for fields without any prefix. Useful for generation of field labels when paired with DuplicateRecordFields language extension so that no prefixes for field names are necessary.

Since: optics-th-0.2

underscoreFields :: LensRules #

Field rules for fields in the form _prefix_fieldname

camelCaseFields :: LensRules #

Field rules for fields in the form prefixFieldname or _prefixFieldname

If you want all fields to be lensed, then there is no reason to use an _ before the prefix. If any of the record fields leads with an _ then it is assume a field without an _ should not have a lens created.

Note: The prefix must be the same as the typename (with the first letter lowercased). This is a change from lens versions before lens 4.5. If you want the old behaviour, use makeLensesWith abbreviatedFields

classUnderscoreNoPrefixFields :: LensRules #

Field rules for fields in the form _fieldname (the leading underscore is mandatory).

Note: The primary difference to camelCaseFields is that for classUnderscoreNoPrefixFields the field names are not expected to be prefixed with the type name. This might be the desired behaviour when the DuplicateRecordFields extension is enabled.

abbreviatedFields :: LensRules #

Field rules fields in the form prefixFieldname or _prefixFieldname If you want all fields to be lensed, then there is no reason to use an _ before the prefix. If any of the record fields leads with an _ then it is assume a field without an _ should not have a lens created.

Note that prefix may be any string of characters that are not uppercase letters. (In particular, it may be arbitrary string of lowercase letters and numbers) This is the behavior that defaultFieldRules had in lens 4.4 and earlier.

noPrefixNamer :: FieldNamer #

A FieldNamer that leaves the field name as-is. Useful for generation of field labels when paired with DuplicateRecordFields language extension so that no prefixes for field names are necessary.

Since: optics-th-0.2

underscoreNoPrefixNamer :: FieldNamer #

A FieldNamer that strips the _ off of the field name, lowercases the name, and skips the field if it doesn't start with an '_'.

lookingupNamer :: [(String, String)] -> FieldNamer #

Create a FieldNamer from explicit pairings of (fieldName, lensName).

mappingNamer #

Arguments

:: (String -> [String])

A function that maps a fieldName to lensNames.

-> FieldNamer 

Create a FieldNamer from a mapping function. If the function returns [], it creates no lens for the field.

class ViewableOptic k r #

Generalized view (even more powerful than view from the lens library).

View the value(s) pointed to by an optic.

The type of the result depends on the optic. You get:

When in doubt, use specific, flavour restricted versions. This function is mostly useful for things such as passthrough.

Minimal complete definition

gview, gviews

Associated Types

type ViewResult k r #

Instances

Instances details
Monoid r => ViewableOptic A_Fold r 
Instance details

Defined in Optics.View

Associated Types

type ViewResult A_Fold r #

Methods

gview :: forall s m (is :: IxList). MonadReader s m => Optic' A_Fold is s r -> m (ViewResult A_Fold r) #

gviews :: forall s m (is :: IxList) a. MonadReader s m => Optic' A_Fold is s a -> (a -> r) -> m (ViewResult A_Fold r) #

ViewableOptic An_AffineFold r 
Instance details

Defined in Optics.View

Associated Types

type ViewResult An_AffineFold r #

Methods

gview :: forall s m (is :: IxList). MonadReader s m => Optic' An_AffineFold is s r -> m (ViewResult An_AffineFold r) #

gviews :: forall s m (is :: IxList) a. MonadReader s m => Optic' An_AffineFold is s a -> (a -> r) -> m (ViewResult An_AffineFold r) #

ViewableOptic A_Getter r 
Instance details

Defined in Optics.View

Associated Types

type ViewResult A_Getter r #

Methods

gview :: forall s m (is :: IxList). MonadReader s m => Optic' A_Getter is s r -> m (ViewResult A_Getter r) #

gviews :: forall s m (is :: IxList) a. MonadReader s m => Optic' A_Getter is s a -> (a -> r) -> m (ViewResult A_Getter r) #

ViewableOptic A_ReversedPrism r 
Instance details

Defined in Optics.View

Associated Types

type ViewResult A_ReversedPrism r #

Methods

gview :: forall s m (is :: IxList). MonadReader s m => Optic' A_ReversedPrism is s r -> m (ViewResult A_ReversedPrism r) #

gviews :: forall s m (is :: IxList) a. MonadReader s m => Optic' A_ReversedPrism is s a -> (a -> r) -> m (ViewResult A_ReversedPrism r) #

Monoid r => ViewableOptic A_Traversal r 
Instance details

Defined in Optics.View

Associated Types

type ViewResult A_Traversal r #

Methods

gview :: forall s m (is :: IxList). MonadReader s m => Optic' A_Traversal is s r -> m (ViewResult A_Traversal r) #

gviews :: forall s m (is :: IxList) a. MonadReader s m => Optic' A_Traversal is s a -> (a -> r) -> m (ViewResult A_Traversal r) #

ViewableOptic An_AffineTraversal r 
Instance details

Defined in Optics.View

Associated Types

type ViewResult An_AffineTraversal r #

Methods

gview :: forall s m (is :: IxList). MonadReader s m => Optic' An_AffineTraversal is s r -> m (ViewResult An_AffineTraversal r) #

gviews :: forall s m (is :: IxList) a. MonadReader s m => Optic' An_AffineTraversal is s a -> (a -> r) -> m (ViewResult An_AffineTraversal r) #

ViewableOptic A_Prism r 
Instance details

Defined in Optics.View

Associated Types

type ViewResult A_Prism r #

Methods

gview :: forall s m (is :: IxList). MonadReader s m => Optic' A_Prism is s r -> m (ViewResult A_Prism r) #

gviews :: forall s m (is :: IxList) a. MonadReader s m => Optic' A_Prism is s a -> (a -> r) -> m (ViewResult A_Prism r) #

ViewableOptic A_Lens r 
Instance details

Defined in Optics.View

Associated Types

type ViewResult A_Lens r #

Methods

gview :: forall s m (is :: IxList). MonadReader s m => Optic' A_Lens is s r -> m (ViewResult A_Lens r) #

gviews :: forall s m (is :: IxList) a. MonadReader s m => Optic' A_Lens is s a -> (a -> r) -> m (ViewResult A_Lens r) #

ViewableOptic An_Iso r 
Instance details

Defined in Optics.View

Associated Types

type ViewResult An_Iso r #

Methods

gview :: forall s m (is :: IxList). MonadReader s m => Optic' An_Iso is s r -> m (ViewResult An_Iso r) #

gviews :: forall s m (is :: IxList) a. MonadReader s m => Optic' An_Iso is s a -> (a -> r) -> m (ViewResult An_Iso r) #

type family ViewResult k r #

Instances

Instances details
type ViewResult A_Fold r 
Instance details

Defined in Optics.View

type ViewResult A_Fold r = r
type ViewResult An_AffineFold r 
Instance details

Defined in Optics.View

type ViewResult A_Getter r 
Instance details

Defined in Optics.View

type ViewResult A_Getter r = r
type ViewResult A_ReversedPrism r 
Instance details

Defined in Optics.View

type ViewResult A_Traversal r 
Instance details

Defined in Optics.View

type ViewResult An_AffineTraversal r 
Instance details

Defined in Optics.View

type ViewResult A_Prism r 
Instance details

Defined in Optics.View

type ViewResult A_Lens r 
Instance details

Defined in Optics.View

type ViewResult A_Lens r = r
type ViewResult An_Iso r 
Instance details

Defined in Optics.View

type ViewResult An_Iso r = r

class (MonadReader b m, MonadReader a n, Magnify m n b a) => MagnifyMany (m :: Type -> Type) (n :: Type -> Type) b a | m -> b, n -> a, m a -> n, n b -> m where #

Extends Magnify with an ability to magnify using a Fold over multiple targets so that actions for each one are executed sequentially and the results are aggregated.

There is however no sensible instance of MagnifyMany for StateT.

Methods

magnifyMany :: forall k c (is :: IxList). (Is k A_Fold, Monoid c) => Optic' k is a b -> m c -> n c infixr 2 #

Instances

Instances details
MagnifyMany m n b a => MagnifyMany (MaybeT m) (MaybeT n) b a 
Instance details

Defined in Optics.Zoom

Methods

magnifyMany :: forall k c (is :: IxList). (Is k A_Fold, Monoid c) => Optic' k is a b -> MaybeT m c -> MaybeT n c #

MagnifyMany m n b a => MagnifyMany (ListT m) (ListT n) b a 
Instance details

Defined in Optics.Zoom

Methods

magnifyMany :: forall k c (is :: IxList). (Is k A_Fold, Monoid c) => Optic' k is a b -> ListT m c -> ListT n c #

MagnifyMany m n b a => MagnifyMany (ExceptT e m) (ExceptT e n) b a 
Instance details

Defined in Optics.Zoom

Methods

magnifyMany :: forall k c (is :: IxList). (Is k A_Fold, Monoid c) => Optic' k is a b -> ExceptT e m c -> ExceptT e n c #

MagnifyMany m n b a => MagnifyMany (IdentityT m) (IdentityT n) b a 
Instance details

Defined in Optics.Zoom

Methods

magnifyMany :: forall k c (is :: IxList). (Is k A_Fold, Monoid c) => Optic' k is a b -> IdentityT m c -> IdentityT n c #

(Error e, MagnifyMany m n b a) => MagnifyMany (ErrorT e m) (ErrorT e n) b a 
Instance details

Defined in Optics.Zoom

Methods

magnifyMany :: forall k c (is :: IxList). (Is k A_Fold, Monoid c) => Optic' k is a b -> ErrorT e m c -> ErrorT e n c #

Monad m => MagnifyMany (ReaderT b m) (ReaderT a m) b a 
Instance details

Defined in Optics.Zoom

Methods

magnifyMany :: forall k c (is :: IxList). (Is k A_Fold, Monoid c) => Optic' k is a b -> ReaderT b m c -> ReaderT a m c #

(Monoid w, MagnifyMany m n b a) => MagnifyMany (WriterT w m) (WriterT w n) b a 
Instance details

Defined in Optics.Zoom

Methods

magnifyMany :: forall k c (is :: IxList). (Is k A_Fold, Monoid c) => Optic' k is a b -> WriterT w m c -> WriterT w n c #

(Monoid w, MagnifyMany m n b a) => MagnifyMany (WriterT w m) (WriterT w n) b a 
Instance details

Defined in Optics.Zoom

Methods

magnifyMany :: forall k c (is :: IxList). (Is k A_Fold, Monoid c) => Optic' k is a b -> WriterT w m c -> WriterT w n c #

MagnifyMany ((->) b :: Type -> Type) ((->) a :: Type -> Type) b a
magnifyMany = foldMapOf
Instance details

Defined in Optics.Zoom

Methods

magnifyMany :: forall k c (is :: IxList). (Is k A_Fold, Monoid c) => Optic' k is a b -> (b -> c) -> a -> c #

(Monad m, Monoid w) => MagnifyMany (RWST b w s m) (RWST a w s m) b a 
Instance details

Defined in Optics.Zoom

Methods

magnifyMany :: forall k c (is :: IxList). (Is k A_Fold, Monoid c) => Optic' k is a b -> RWST b w s m c -> RWST a w s m c #

(Monad m, Monoid w) => MagnifyMany (RWST b w s m) (RWST a w s m) b a 
Instance details

Defined in Optics.Zoom

Methods

magnifyMany :: forall k c (is :: IxList). (Is k A_Fold, Monoid c) => Optic' k is a b -> RWST b w s m c -> RWST a w s m c #

class AppendIndices (xs :: IxList) (ys :: IxList) (ks :: IxList) | xs ys -> ks #

In pseudo (dependent-)Haskell, provide a witness

foldr f (foldr f init xs) ys = foldr f init (ys ++ xs)
   where f = (->)

Since: optics-core-0.4

Minimal complete definition

appendIndices

Instances

Instances details
AppendIndices xs ('[] :: [Type]) xs

If the second list is empty, we can shortcircuit and pick the first list immediately.

Instance details

Defined in Optics.Internal.Optic.TypeLevel

Methods

appendIndices :: IxEq i (Curry xs (Curry '[] i)) (Curry xs i) #

AppendIndices ('[] :: [Type]) ys ys 
Instance details

Defined in Optics.Internal.Optic.TypeLevel

Methods

appendIndices :: IxEq i (Curry '[] (Curry ys i)) (Curry ys i) #

AppendIndices xs ys ks => AppendIndices (x ': xs) ys (x ': ks) 
Instance details

Defined in Optics.Internal.Optic.TypeLevel

Methods

appendIndices :: IxEq i (Curry (x ': xs) (Curry ys i)) (Curry (x ': ks) i) #

class CurryCompose (xs :: IxList) where #

Class that is inhabited by all type-level lists xs, providing the ability to compose a function under Curry xs.

Methods

composeN :: (i -> j) -> Curry xs i -> Curry xs j #

Compose a function under Curry xs. This generalises (.) (aka fmap for (->)) to work for curried functions with one argument for each type in the list.

Instances

Instances details
CurryCompose ('[] :: [Type]) 
Instance details

Defined in Optics.Internal.Optic.TypeLevel

Methods

composeN :: (i -> j) -> Curry '[] i -> Curry '[] j #

CurryCompose xs => CurryCompose (x ': xs) 
Instance details

Defined in Optics.Internal.Optic.TypeLevel

Methods

composeN :: (i -> j) -> Curry (x ': xs) i -> Curry (x ': xs) j #

type family Curry (xs :: IxList) y where ... #

Curry a type-level list.

In pseudo (dependent-)Haskell:

Curry xs y = foldr (->) y xs

Equations

Curry ('[] :: [Type]) y = y 
Curry (x ': xs) y = x -> Curry xs y 

type WithIx i = '[i] #

Singleton index list

type NoIx = '[] :: [Type] #

An alias for an empty index-list

type IxList = [Type] #

A list of index types, used for indexed optics.

Since: optics-core-0.2

data A_Review #

Tag for a review.

Instances

Instances details
ReversibleOptic A_Review 
Instance details

Defined in Optics.Re

Associated Types

type ReversedOptic A_Review = (r :: Type) #

Methods

re :: forall (is :: IxList) s t a b. AcceptsEmptyIndices "re" is => Optic A_Review is s t a b -> Optic (ReversedOptic A_Review) is b a t s #

Is A_ReversedLens A_Review 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

implies :: forall (p :: Type -> Type -> Type -> Type) r. (Constraints A_ReversedLens p => r) -> Constraints A_Review p => r #

Is A_Prism A_Review 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

implies :: forall (p :: Type -> Type -> Type -> Type) r. (Constraints A_Prism p => r) -> Constraints A_Review p => r #

Is An_Iso A_Review 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

implies :: forall (p :: Type -> Type -> Type -> Type) r. (Constraints An_Iso p => r) -> Constraints A_Review p => r #

k ~ A_Review => JoinKinds A_Review A_Review k 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

joinKinds :: forall (p :: Type -> Type -> Type -> Type) r. ((Constraints A_Review p, Constraints A_Review p) => r) -> Constraints k p => r #

k ~ A_Review => JoinKinds A_Review A_ReversedLens k 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

joinKinds :: forall (p :: Type -> Type -> Type -> Type) r. ((Constraints A_Review p, Constraints A_ReversedLens p) => r) -> Constraints k p => r #

k ~ A_Review => JoinKinds A_Review A_Prism k 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

joinKinds :: forall (p :: Type -> Type -> Type -> Type) r. ((Constraints A_Review p, Constraints A_Prism p) => r) -> Constraints k p => r #

k ~ A_Review => JoinKinds A_Review An_Iso k 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

joinKinds :: forall (p :: Type -> Type -> Type -> Type) r. ((Constraints A_Review p, Constraints An_Iso p) => r) -> Constraints k p => r #

k ~ A_Review => JoinKinds A_ReversedLens A_Review k 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

joinKinds :: forall (p :: Type -> Type -> Type -> Type) r. ((Constraints A_ReversedLens p, Constraints A_Review p) => r) -> Constraints k p => r #

k ~ A_Review => JoinKinds A_Prism A_Review k 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

joinKinds :: forall (p :: Type -> Type -> Type -> Type) r. ((Constraints A_Prism p, Constraints A_Review p) => r) -> Constraints k p => r #

k ~ A_Review => JoinKinds An_Iso A_Review k 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

joinKinds :: forall (p :: Type -> Type -> Type -> Type) r. ((Constraints An_Iso p, Constraints A_Review p) => r) -> Constraints k p => r #

(Functor f, f ~ g, s ~ t, a ~ b) => MappingOptic A_Review f g s t a b 
Instance details

Defined in Optics.Mapping

Associated Types

type MappedOptic A_Review #

Methods

mapping :: forall (is :: IxList). AcceptsEmptyIndices "mapping" is => Optic A_Review is s t a b -> Optic (MappedOptic A_Review) is (f s) (g t) (f a) (g b) #

type ReversedOptic A_Review 
Instance details

Defined in Optics.Re

type MappedOptic A_Review 
Instance details

Defined in Optics.Mapping

data A_ReversedLens #

Tag for a reversed lens.

Instances

Instances details
ReversibleOptic A_ReversedLens 
Instance details

Defined in Optics.Re

Associated Types

type ReversedOptic A_ReversedLens = (r :: Type) #

Methods

re :: forall (is :: IxList) s t a b. AcceptsEmptyIndices "re" is => Optic A_ReversedLens is s t a b -> Optic (ReversedOptic A_ReversedLens) is b a t s #

Is A_ReversedLens A_Review 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

implies :: forall (p :: Type -> Type -> Type -> Type) r. (Constraints A_ReversedLens p => r) -> Constraints A_Review p => r #

Is An_Iso A_ReversedLens 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

implies :: forall (p :: Type -> Type -> Type -> Type) r. (Constraints An_Iso p => r) -> Constraints A_ReversedLens p => r #

k ~ A_Review => JoinKinds A_Review A_ReversedLens k 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

joinKinds :: forall (p :: Type -> Type -> Type -> Type) r. ((Constraints A_Review p, Constraints A_ReversedLens p) => r) -> Constraints k p => r #

k ~ A_Review => JoinKinds A_ReversedLens A_Review k 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

joinKinds :: forall (p :: Type -> Type -> Type -> Type) r. ((Constraints A_ReversedLens p, Constraints A_Review p) => r) -> Constraints k p => r #

k ~ A_ReversedLens => JoinKinds A_ReversedLens A_ReversedLens k 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

joinKinds :: forall (p :: Type -> Type -> Type -> Type) r. ((Constraints A_ReversedLens p, Constraints A_ReversedLens p) => r) -> Constraints k p => r #

k ~ A_Review => JoinKinds A_ReversedLens A_Prism k 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

joinKinds :: forall (p :: Type -> Type -> Type -> Type) r. ((Constraints A_ReversedLens p, Constraints A_Prism p) => r) -> Constraints k p => r #

k ~ A_ReversedLens => JoinKinds A_ReversedLens An_Iso k 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

joinKinds :: forall (p :: Type -> Type -> Type -> Type) r. ((Constraints A_ReversedLens p, Constraints An_Iso p) => r) -> Constraints k p => r #

k ~ A_Review => JoinKinds A_Prism A_ReversedLens k 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

joinKinds :: forall (p :: Type -> Type -> Type -> Type) r. ((Constraints A_Prism p, Constraints A_ReversedLens p) => r) -> Constraints k p => r #

k ~ A_ReversedLens => JoinKinds An_Iso A_ReversedLens k 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

joinKinds :: forall (p :: Type -> Type -> Type -> Type) r. ((Constraints An_Iso p, Constraints A_ReversedLens p) => r) -> Constraints k p => r #

(Functor f, f ~ g, s ~ t, a ~ b) => MappingOptic A_ReversedLens f g s t a b 
Instance details

Defined in Optics.Mapping

Associated Types

type MappedOptic A_ReversedLens #

Methods

mapping :: forall (is :: IxList). AcceptsEmptyIndices "mapping" is => Optic A_ReversedLens is s t a b -> Optic (MappedOptic A_ReversedLens) is (f s) (g t) (f a) (g b) #

type ReversedOptic A_ReversedLens 
Instance details

Defined in Optics.Re

type MappedOptic A_ReversedLens 
Instance details

Defined in Optics.Mapping

data A_Fold #

Tag for a fold.

Instances

Instances details
Monoid r => ViewableOptic A_Fold r 
Instance details

Defined in Optics.View

Associated Types

type ViewResult A_Fold r #

Methods

gview :: forall s m (is :: IxList). MonadReader s m => Optic' A_Fold is s r -> m (ViewResult A_Fold r) #

gviews :: forall s m (is :: IxList) a. MonadReader s m => Optic' A_Fold is s a -> (a -> r) -> m (ViewResult A_Fold r) #

Is An_AffineFold A_Fold 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

implies :: forall (p :: Type -> Type -> Type -> Type) r. (Constraints An_AffineFold p => r) -> Constraints A_Fold p => r #

Is A_Getter A_Fold 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

implies :: forall (p :: Type -> Type -> Type -> Type) r. (Constraints A_Getter p => r) -> Constraints A_Fold p => r #

Is A_ReversedPrism A_Fold 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

implies :: forall (p :: Type -> Type -> Type -> Type) r. (Constraints A_ReversedPrism p => r) -> Constraints A_Fold p => r #

Is A_Traversal A_Fold 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

implies :: forall (p :: Type -> Type -> Type -> Type) r. (Constraints A_Traversal p => r) -> Constraints A_Fold p => r #

Is An_AffineTraversal A_Fold 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

implies :: forall (p :: Type -> Type -> Type -> Type) r. (Constraints An_AffineTraversal p => r) -> Constraints A_Fold p => r #

Is A_Prism A_Fold 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

implies :: forall (p :: Type -> Type -> Type -> Type) r. (Constraints A_Prism p => r) -> Constraints A_Fold p => r #

Is A_Lens A_Fold 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

implies :: forall (p :: Type -> Type -> Type -> Type) r. (Constraints A_Lens p => r) -> Constraints A_Fold p => r #

Is An_Iso A_Fold 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

implies :: forall (p :: Type -> Type -> Type -> Type) r. (Constraints An_Iso p => r) -> Constraints A_Fold p => r #

k ~ A_Fold => JoinKinds A_Fold A_Fold k 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

joinKinds :: forall (p :: Type -> Type -> Type -> Type) r. ((Constraints A_Fold p, Constraints A_Fold p) => r) -> Constraints k p => r #

k ~ A_Fold => JoinKinds A_Fold An_AffineFold k 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

joinKinds :: forall (p :: Type -> Type -> Type -> Type) r. ((Constraints A_Fold p, Constraints An_AffineFold p) => r) -> Constraints k p => r #

k ~ A_Fold => JoinKinds A_Fold A_Getter k 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

joinKinds :: forall (p :: Type -> Type -> Type -> Type) r. ((Constraints A_Fold p, Constraints A_Getter p) => r) -> Constraints k p => r #

k ~ A_Fold => JoinKinds A_Fold A_ReversedPrism k 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

joinKinds :: forall (p :: Type -> Type -> Type -> Type) r. ((Constraints A_Fold p, Constraints A_ReversedPrism p) => r) -> Constraints k p => r #

k ~ A_Fold => JoinKinds A_Fold A_Traversal k 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

joinKinds :: forall (p :: Type -> Type -> Type -> Type) r. ((Constraints A_Fold p, Constraints A_Traversal p) => r) -> Constraints k p => r #

k ~ A_Fold => JoinKinds A_Fold An_AffineTraversal k 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

joinKinds :: forall (p :: Type -> Type -> Type -> Type) r. ((Constraints A_Fold p, Constraints An_AffineTraversal p) => r) -> Constraints k p => r #

k ~ A_Fold => JoinKinds A_Fold A_Prism k 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

joinKinds :: forall (p :: Type -> Type -> Type -> Type) r. ((Constraints A_Fold p, Constraints A_Prism p) => r) -> Constraints k p => r #

k ~ A_Fold => JoinKinds A_Fold A_Lens k 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

joinKinds :: forall (p :: Type -> Type -> Type -> Type) r. ((Constraints A_Fold p, Constraints A_Lens p) => r) -> Constraints k p => r #

k ~ A_Fold => JoinKinds A_Fold An_Iso k 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

joinKinds :: forall (p :: Type -> Type -> Type -> Type) r. ((Constraints A_Fold p, Constraints An_Iso p) => r) -> Constraints k p => r #

k ~ A_Fold => JoinKinds An_AffineFold A_Fold k 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

joinKinds :: forall (p :: Type -> Type -> Type -> Type) r. ((Constraints An_AffineFold p, Constraints A_Fold p) => r) -> Constraints k p => r #

k ~ A_Fold => JoinKinds A_Getter A_Fold k 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

joinKinds :: forall (p :: Type -> Type -> Type -> Type) r. ((Constraints A_Getter p, Constraints A_Fold p) => r) -> Constraints k p => r #

k ~ A_Fold => JoinKinds A_ReversedPrism A_Fold k 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

joinKinds :: forall (p :: Type -> Type -> Type -> Type) r. ((Constraints A_ReversedPrism p, Constraints A_Fold p) => r) -> Constraints k p => r #

k ~ A_Fold => JoinKinds A_Traversal A_Fold k 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

joinKinds :: forall (p :: Type -> Type -> Type -> Type) r. ((Constraints A_Traversal p, Constraints A_Fold p) => r) -> Constraints k p => r #

k ~ A_Fold => JoinKinds An_AffineTraversal A_Fold k 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

joinKinds :: forall (p :: Type -> Type -> Type -> Type) r. ((Constraints An_AffineTraversal p, Constraints A_Fold p) => r) -> Constraints k p => r #

k ~ A_Fold => JoinKinds A_Prism A_Fold k 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

joinKinds :: forall (p :: Type -> Type -> Type -> Type) r. ((Constraints A_Prism p, Constraints A_Fold p) => r) -> Constraints k p => r #

k ~ A_Fold => JoinKinds A_Lens A_Fold k 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

joinKinds :: forall (p :: Type -> Type -> Type -> Type) r. ((Constraints A_Lens p, Constraints A_Fold p) => r) -> Constraints k p => r #

k ~ A_Fold => JoinKinds An_Iso A_Fold k 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

joinKinds :: forall (p :: Type -> Type -> Type -> Type) r. ((Constraints An_Iso p, Constraints A_Fold p) => r) -> Constraints k p => r #

(s ~ t, a ~ b) => ToReadOnly A_Fold s t a b 
Instance details

Defined in Optics.ReadOnly

Associated Types

type ReadOnlyOptic A_Fold #

Methods

getting :: forall (is :: IxList). Optic A_Fold is s t a b -> Optic' (ReadOnlyOptic A_Fold) is s a #

(s ~ t, a ~ b) => IxOptic A_Fold s t a b 
Instance details

Defined in Optics.Indexed.Core

Methods

noIx :: forall (is :: IxList). NonEmptyIndices is => Optic A_Fold is s t a b -> Optic A_Fold NoIx s t a b #

type ReadOnlyOptic A_Fold 
Instance details

Defined in Optics.ReadOnly

type ViewResult A_Fold r 
Instance details

Defined in Optics.View

type ViewResult A_Fold r = r

data An_AffineFold #

Tag for an affine fold.

Instances

Instances details
ViewableOptic An_AffineFold r 
Instance details

Defined in Optics.View

Associated Types

type ViewResult An_AffineFold r #

Methods

gview :: forall s m (is :: IxList). MonadReader s m => Optic' An_AffineFold is s r -> m (ViewResult An_AffineFold r) #

gviews :: forall s m (is :: IxList) a. MonadReader s m => Optic' An_AffineFold is s a -> (a -> r) -> m (ViewResult An_AffineFold r) #

Is An_AffineFold A_Fold 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

implies :: forall (p :: Type -> Type -> Type -> Type) r. (Constraints An_AffineFold p => r) -> Constraints A_Fold p => r #

Is A_Getter An_AffineFold 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

implies :: forall (p :: Type -> Type -> Type -> Type) r. (Constraints A_Getter p => r) -> Constraints An_AffineFold p => r #

Is A_ReversedPrism An_AffineFold 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

implies :: forall (p :: Type -> Type -> Type -> Type) r. (Constraints A_ReversedPrism p => r) -> Constraints An_AffineFold p => r #

Is An_AffineTraversal An_AffineFold 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

implies :: forall (p :: Type -> Type -> Type -> Type) r. (Constraints An_AffineTraversal p => r) -> Constraints An_AffineFold p => r #

Is A_Prism An_AffineFold 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

implies :: forall (p :: Type -> Type -> Type -> Type) r. (Constraints A_Prism p => r) -> Constraints An_AffineFold p => r #

Is A_Lens An_AffineFold 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

implies :: forall (p :: Type -> Type -> Type -> Type) r. (Constraints A_Lens p => r) -> Constraints An_AffineFold p => r #

Is An_Iso An_AffineFold 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

implies :: forall (p :: Type -> Type -> Type -> Type) r. (Constraints An_Iso p => r) -> Constraints An_AffineFold p => r #

k ~ A_Fold => JoinKinds A_Fold An_AffineFold k 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

joinKinds :: forall (p :: Type -> Type -> Type -> Type) r. ((Constraints A_Fold p, Constraints An_AffineFold p) => r) -> Constraints k p => r #

k ~ A_Fold => JoinKinds An_AffineFold A_Fold k 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

joinKinds :: forall (p :: Type -> Type -> Type -> Type) r. ((Constraints An_AffineFold p, Constraints A_Fold p) => r) -> Constraints k p => r #

k ~ An_AffineFold => JoinKinds An_AffineFold An_AffineFold k 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

joinKinds :: forall (p :: Type -> Type -> Type -> Type) r. ((Constraints An_AffineFold p, Constraints An_AffineFold p) => r) -> Constraints k p => r #

k ~ An_AffineFold => JoinKinds An_AffineFold A_Getter k 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

joinKinds :: forall (p :: Type -> Type -> Type -> Type) r. ((Constraints An_AffineFold p, Constraints A_Getter p) => r) -> Constraints k p => r #

k ~ An_AffineFold => JoinKinds An_AffineFold A_ReversedPrism k 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

joinKinds :: forall (p :: Type -> Type -> Type -> Type) r. ((Constraints An_AffineFold p, Constraints A_ReversedPrism p) => r) -> Constraints k p => r #

k ~ A_Fold => JoinKinds An_AffineFold A_Traversal k 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

joinKinds :: forall (p :: Type -> Type -> Type -> Type) r. ((Constraints An_AffineFold p, Constraints A_Traversal p) => r) -> Constraints k p => r #

k ~ An_AffineFold => JoinKinds An_AffineFold An_AffineTraversal k 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

joinKinds :: forall (p :: Type -> Type -> Type -> Type) r. ((Constraints An_AffineFold p, Constraints An_AffineTraversal p) => r) -> Constraints k p => r #

k ~ An_AffineFold => JoinKinds An_AffineFold A_Prism k 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

joinKinds :: forall (p :: Type -> Type -> Type -> Type) r. ((Constraints An_AffineFold p, Constraints A_Prism p) => r) -> Constraints k p => r #

k ~ An_AffineFold => JoinKinds An_AffineFold A_Lens k 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

joinKinds :: forall (p :: Type -> Type -> Type -> Type) r. ((Constraints An_AffineFold p, Constraints A_Lens p) => r) -> Constraints k p => r #

k ~ An_AffineFold => JoinKinds An_AffineFold An_Iso k 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

joinKinds :: forall (p :: Type -> Type -> Type -> Type) r. ((Constraints An_AffineFold p, Constraints An_Iso p) => r) -> Constraints k p => r #

k ~ An_AffineFold => JoinKinds A_Getter An_AffineFold k 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

joinKinds :: forall (p :: Type -> Type -> Type -> Type) r. ((Constraints A_Getter p, Constraints An_AffineFold p) => r) -> Constraints k p => r #

k ~ An_AffineFold => JoinKinds A_ReversedPrism An_AffineFold k 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

joinKinds :: forall (p :: Type -> Type -> Type -> Type) r. ((Constraints A_ReversedPrism p, Constraints An_AffineFold p) => r) -> Constraints k p => r #

k ~ A_Fold => JoinKinds A_Traversal An_AffineFold k 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

joinKinds :: forall (p :: Type -> Type -> Type -> Type) r. ((Constraints A_Traversal p, Constraints An_AffineFold p) => r) -> Constraints k p => r #

k ~ An_AffineFold => JoinKinds An_AffineTraversal An_AffineFold k 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

joinKinds :: forall (p :: Type -> Type -> Type -> Type) r. ((Constraints An_AffineTraversal p, Constraints An_AffineFold p) => r) -> Constraints k p => r #

k ~ An_AffineFold => JoinKinds A_Prism An_AffineFold k 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

joinKinds :: forall (p :: Type -> Type -> Type -> Type) r. ((Constraints A_Prism p, Constraints An_AffineFold p) => r) -> Constraints k p => r #

k ~ An_AffineFold => JoinKinds A_Lens An_AffineFold k 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

joinKinds :: forall (p :: Type -> Type -> Type -> Type) r. ((Constraints A_Lens p, Constraints An_AffineFold p) => r) -> Constraints k p => r #

k ~ An_AffineFold => JoinKinds An_Iso An_AffineFold k 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

joinKinds :: forall (p :: Type -> Type -> Type -> Type) r. ((Constraints An_Iso p, Constraints An_AffineFold p) => r) -> Constraints k p => r #

(s ~ t, a ~ b) => ToReadOnly An_AffineFold s t a b 
Instance details

Defined in Optics.ReadOnly

Associated Types

type ReadOnlyOptic An_AffineFold #

Methods

getting :: forall (is :: IxList). Optic An_AffineFold is s t a b -> Optic' (ReadOnlyOptic An_AffineFold) is s a #

(s ~ t, a ~ b) => IxOptic An_AffineFold s t a b 
Instance details

Defined in Optics.Indexed.Core

Methods

noIx :: forall (is :: IxList). NonEmptyIndices is => Optic An_AffineFold is s t a b -> Optic An_AffineFold NoIx s t a b #

type ReadOnlyOptic An_AffineFold 
Instance details

Defined in Optics.ReadOnly

type ViewResult An_AffineFold r 
Instance details

Defined in Optics.View

data A_Getter #

Tag for a getter.

Instances

Instances details
ReversibleOptic A_Getter 
Instance details

Defined in Optics.Re

Associated Types

type ReversedOptic A_Getter = (r :: Type) #

Methods

re :: forall (is :: IxList) s t a b. AcceptsEmptyIndices "re" is => Optic A_Getter is s t a b -> Optic (ReversedOptic A_Getter) is b a t s #

ViewableOptic A_Getter r 
Instance details

Defined in Optics.View

Associated Types

type ViewResult A_Getter r #

Methods

gview :: forall s m (is :: IxList). MonadReader s m => Optic' A_Getter is s r -> m (ViewResult A_Getter r) #

gviews :: forall s m (is :: IxList) a. MonadReader s m => Optic' A_Getter is s a -> (a -> r) -> m (ViewResult A_Getter r) #

Is A_Getter A_Fold 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

implies :: forall (p :: Type -> Type -> Type -> Type) r. (Constraints A_Getter p => r) -> Constraints A_Fold p => r #

Is A_Getter An_AffineFold 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

implies :: forall (p :: Type -> Type -> Type -> Type) r. (Constraints A_Getter p => r) -> Constraints An_AffineFold p => r #

Is A_ReversedPrism A_Getter 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

implies :: forall (p :: Type -> Type -> Type -> Type) r. (Constraints A_ReversedPrism p => r) -> Constraints A_Getter p => r #

Is A_Lens A_Getter 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

implies :: forall (p :: Type -> Type -> Type -> Type) r. (Constraints A_Lens p => r) -> Constraints A_Getter p => r #

Is An_Iso A_Getter 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

implies :: forall (p :: Type -> Type -> Type -> Type) r. (Constraints An_Iso p => r) -> Constraints A_Getter p => r #

k ~ A_Fold => JoinKinds A_Fold A_Getter k 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

joinKinds :: forall (p :: Type -> Type -> Type -> Type) r. ((Constraints A_Fold p, Constraints A_Getter p) => r) -> Constraints k p => r #

k ~ An_AffineFold => JoinKinds An_AffineFold A_Getter k 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

joinKinds :: forall (p :: Type -> Type -> Type -> Type) r. ((Constraints An_AffineFold p, Constraints A_Getter p) => r) -> Constraints k p => r #

k ~ A_Fold => JoinKinds A_Getter A_Fold k 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

joinKinds :: forall (p :: Type -> Type -> Type -> Type) r. ((Constraints A_Getter p, Constraints A_Fold p) => r) -> Constraints k p => r #

k ~ An_AffineFold => JoinKinds A_Getter An_AffineFold k 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

joinKinds :: forall (p :: Type -> Type -> Type -> Type) r. ((Constraints A_Getter p, Constraints An_AffineFold p) => r) -> Constraints k p => r #

k ~ A_Getter => JoinKinds A_Getter A_Getter k 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

joinKinds :: forall (p :: Type -> Type -> Type -> Type) r. ((Constraints A_Getter p, Constraints A_Getter p) => r) -> Constraints k p => r #

k ~ A_Getter => JoinKinds A_Getter A_ReversedPrism k 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

joinKinds :: forall (p :: Type -> Type -> Type -> Type) r. ((Constraints A_Getter p, Constraints A_ReversedPrism p) => r) -> Constraints k p => r #

k ~ A_Fold => JoinKinds A_Getter A_Traversal k 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

joinKinds :: forall (p :: Type -> Type -> Type -> Type) r. ((Constraints A_Getter p, Constraints A_Traversal p) => r) -> Constraints k p => r #

k ~ An_AffineFold => JoinKinds A_Getter An_AffineTraversal k 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

joinKinds :: forall (p :: Type -> Type -> Type -> Type) r. ((Constraints A_Getter p, Constraints An_AffineTraversal p) => r) -> Constraints k p => r #

k ~ An_AffineFold => JoinKinds A_Getter A_Prism k 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

joinKinds :: forall (p :: Type -> Type -> Type -> Type) r. ((Constraints A_Getter p, Constraints A_Prism p) => r) -> Constraints k p => r #

k ~ A_Getter => JoinKinds A_Getter A_Lens k 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

joinKinds :: forall (p :: Type -> Type -> Type -> Type) r. ((Constraints A_Getter p, Constraints A_Lens p) => r) -> Constraints k p => r #

k ~ A_Getter => JoinKinds A_Getter An_Iso k 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

joinKinds :: forall (p :: Type -> Type -> Type -> Type) r. ((Constraints A_Getter p, Constraints An_Iso p) => r) -> Constraints k p => r #

k ~ A_Getter => JoinKinds A_ReversedPrism A_Getter k 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

joinKinds :: forall (p :: Type -> Type -> Type -> Type) r. ((Constraints A_ReversedPrism p, Constraints A_Getter p) => r) -> Constraints k p => r #

k ~ A_Fold => JoinKinds A_Traversal A_Getter k 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

joinKinds :: forall (p :: Type -> Type -> Type -> Type) r. ((Constraints A_Traversal p, Constraints A_Getter p) => r) -> Constraints k p => r #

k ~ An_AffineFold => JoinKinds An_AffineTraversal A_Getter k 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

joinKinds :: forall (p :: Type -> Type -> Type -> Type) r. ((Constraints An_AffineTraversal p, Constraints A_Getter p) => r) -> Constraints k p => r #

k ~ An_AffineFold => JoinKinds A_Prism A_Getter k 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

joinKinds :: forall (p :: Type -> Type -> Type -> Type) r. ((Constraints A_Prism p, Constraints A_Getter p) => r) -> Constraints k p => r #

k ~ A_Getter => JoinKinds A_Lens A_Getter k 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

joinKinds :: forall (p :: Type -> Type -> Type -> Type) r. ((Constraints A_Lens p, Constraints A_Getter p) => r) -> Constraints k p => r #

k ~ A_Getter => JoinKinds An_Iso A_Getter k 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

joinKinds :: forall (p :: Type -> Type -> Type -> Type) r. ((Constraints An_Iso p, Constraints A_Getter p) => r) -> Constraints k p => r #

(s ~ t, a ~ b) => ToReadOnly A_Getter s t a b 
Instance details

Defined in Optics.ReadOnly

Associated Types

type ReadOnlyOptic A_Getter #

Methods

getting :: forall (is :: IxList). Optic A_Getter is s t a b -> Optic' (ReadOnlyOptic A_Getter) is s a #

(s ~ t, a ~ b) => IxOptic A_Getter s t a b 
Instance details

Defined in Optics.Indexed.Core

Methods

noIx :: forall (is :: IxList). NonEmptyIndices is => Optic A_Getter is s t a b -> Optic A_Getter NoIx s t a b #

(Functor f, f ~ g, s ~ t, a ~ b) => MappingOptic A_Getter f g s t a b
>>> [('a', True), ('b', False)] ^. _1 %& mapping
"ab"
>>> let v = [[ (('a', True), "foo"), (('b', False), "bar")], [ (('c', True), "xyz") ] ]
>>> v ^. _1 % _2 %& mapping %& mapping
[[True,False],[True]]
Instance details

Defined in Optics.Mapping

Associated Types

type MappedOptic A_Getter #

Methods

mapping :: forall (is :: IxList). AcceptsEmptyIndices "mapping" is => Optic A_Getter is s t a b -> Optic (MappedOptic A_Getter) is (f s) (g t) (f a) (g b) #

type ReversedOptic A_Getter 
Instance details

Defined in Optics.Re

type ReadOnlyOptic A_Getter 
Instance details

Defined in Optics.ReadOnly

type MappedOptic A_Getter 
Instance details

Defined in Optics.Mapping

type ViewResult A_Getter r 
Instance details

Defined in Optics.View

type ViewResult A_Getter r = r

data A_ReversedPrism #

Tag for a reversed prism.

Instances

Instances details
ReversibleOptic A_ReversedPrism 
Instance details

Defined in Optics.Re

Associated Types

type ReversedOptic A_ReversedPrism = (r :: Type) #

Methods

re :: forall (is :: IxList) s t a b. AcceptsEmptyIndices "re" is => Optic A_ReversedPrism is s t a b -> Optic (ReversedOptic A_ReversedPrism) is b a t s #

ViewableOptic A_ReversedPrism r 
Instance details

Defined in Optics.View

Associated Types

type ViewResult A_ReversedPrism r #

Methods

gview :: forall s m (is :: IxList). MonadReader s m => Optic' A_ReversedPrism is s r -> m (ViewResult A_ReversedPrism r) #

gviews :: forall s m (is :: IxList) a. MonadReader s m => Optic' A_ReversedPrism is s a -> (a -> r) -> m (ViewResult A_ReversedPrism r) #

Is A_ReversedPrism A_Fold 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

implies :: forall (p :: Type -> Type -> Type -> Type) r. (Constraints A_ReversedPrism p => r) -> Constraints A_Fold p => r #

Is A_ReversedPrism An_AffineFold 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

implies :: forall (p :: Type -> Type -> Type -> Type) r. (Constraints A_ReversedPrism p => r) -> Constraints An_AffineFold p => r #

Is A_ReversedPrism A_Getter 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

implies :: forall (p :: Type -> Type -> Type -> Type) r. (Constraints A_ReversedPrism p => r) -> Constraints A_Getter p => r #

Is An_Iso A_ReversedPrism 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

implies :: forall (p :: Type -> Type -> Type -> Type) r. (Constraints An_Iso p => r) -> Constraints A_ReversedPrism p => r #

k ~ A_Fold => JoinKinds A_Fold A_ReversedPrism k 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

joinKinds :: forall (p :: Type -> Type -> Type -> Type) r. ((Constraints A_Fold p, Constraints A_ReversedPrism p) => r) -> Constraints k p => r #

k ~ An_AffineFold => JoinKinds An_AffineFold A_ReversedPrism k 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

joinKinds :: forall (p :: Type -> Type -> Type -> Type) r. ((Constraints An_AffineFold p, Constraints A_ReversedPrism p) => r) -> Constraints k p => r #

k ~ A_Getter => JoinKinds A_Getter A_ReversedPrism k 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

joinKinds :: forall (p :: Type -> Type -> Type -> Type) r. ((Constraints A_Getter p, Constraints A_ReversedPrism p) => r) -> Constraints k p => r #

k ~ A_Fold => JoinKinds A_ReversedPrism A_Fold k 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

joinKinds :: forall (p :: Type -> Type -> Type -> Type) r. ((Constraints A_ReversedPrism p, Constraints A_Fold p) => r) -> Constraints k p => r #

k ~ An_AffineFold => JoinKinds A_ReversedPrism An_AffineFold k 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

joinKinds :: forall (p :: Type -> Type -> Type -> Type) r. ((Constraints A_ReversedPrism p, Constraints An_AffineFold p) => r) -> Constraints k p => r #

k ~ A_Getter => JoinKinds A_ReversedPrism A_Getter k 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

joinKinds :: forall (p :: Type -> Type -> Type -> Type) r. ((Constraints A_ReversedPrism p, Constraints A_Getter p) => r) -> Constraints k p => r #

k ~ A_ReversedPrism => JoinKinds A_ReversedPrism A_ReversedPrism k 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

joinKinds :: forall (p :: Type -> Type -> Type -> Type) r. ((Constraints A_ReversedPrism p, Constraints A_ReversedPrism p) => r) -> Constraints k p => r #

k ~ A_Fold => JoinKinds A_ReversedPrism A_Traversal k 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

joinKinds :: forall (p :: Type -> Type -> Type -> Type) r. ((Constraints A_ReversedPrism p, Constraints A_Traversal p) => r) -> Constraints k p => r #

k ~ An_AffineFold => JoinKinds A_ReversedPrism An_AffineTraversal k 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

joinKinds :: forall (p :: Type -> Type -> Type -> Type) r. ((Constraints A_ReversedPrism p, Constraints An_AffineTraversal p) => r) -> Constraints k p => r #

k ~ An_AffineFold => JoinKinds A_ReversedPrism A_Prism k 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

joinKinds :: forall (p :: Type -> Type -> Type -> Type) r. ((Constraints A_ReversedPrism p, Constraints A_Prism p) => r) -> Constraints k p => r #

k ~ A_Getter => JoinKinds A_ReversedPrism A_Lens k 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

joinKinds :: forall (p :: Type -> Type -> Type -> Type) r. ((Constraints A_ReversedPrism p, Constraints A_Lens p) => r) -> Constraints k p => r #

k ~ A_ReversedPrism => JoinKinds A_ReversedPrism An_Iso k 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

joinKinds :: forall (p :: Type -> Type -> Type -> Type) r. ((Constraints A_ReversedPrism p, Constraints An_Iso p) => r) -> Constraints k p => r #

k ~ A_Fold => JoinKinds A_Traversal A_ReversedPrism k 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

joinKinds :: forall (p :: Type -> Type -> Type -> Type) r. ((Constraints A_Traversal p, Constraints A_ReversedPrism p) => r) -> Constraints k p => r #

k ~ An_AffineFold => JoinKinds An_AffineTraversal A_ReversedPrism k 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

joinKinds :: forall (p :: Type -> Type -> Type -> Type) r. ((Constraints An_AffineTraversal p, Constraints A_ReversedPrism p) => r) -> Constraints k p => r #

k ~ An_AffineFold => JoinKinds A_Prism A_ReversedPrism k 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

joinKinds :: forall (p :: Type -> Type -> Type -> Type) r. ((Constraints A_Prism p, Constraints A_ReversedPrism p) => r) -> Constraints k p => r #

k ~ A_Getter => JoinKinds A_Lens A_ReversedPrism k 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

joinKinds :: forall (p :: Type -> Type -> Type -> Type) r. ((Constraints A_Lens p, Constraints A_ReversedPrism p) => r) -> Constraints k p => r #

k ~ A_ReversedPrism => JoinKinds An_Iso A_ReversedPrism k 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

joinKinds :: forall (p :: Type -> Type -> Type -> Type) r. ((Constraints An_Iso p, Constraints A_ReversedPrism p) => r) -> Constraints k p => r #

ToReadOnly A_ReversedPrism s t a b 
Instance details

Defined in Optics.ReadOnly

Associated Types

type ReadOnlyOptic A_ReversedPrism #

Methods

getting :: forall (is :: IxList). Optic A_ReversedPrism is s t a b -> Optic' (ReadOnlyOptic A_ReversedPrism) is s a #

(Functor f, f ~ g, s ~ t, a ~ b) => MappingOptic A_ReversedPrism f g s t a b 
Instance details

Defined in Optics.Mapping

Associated Types

type MappedOptic A_ReversedPrism #

Methods

mapping :: forall (is :: IxList). AcceptsEmptyIndices "mapping" is => Optic A_ReversedPrism is s t a b -> Optic (MappedOptic A_ReversedPrism) is (f s) (g t) (f a) (g b) #

type ReversedOptic A_ReversedPrism 
Instance details

Defined in Optics.Re

type ReadOnlyOptic A_ReversedPrism 
Instance details

Defined in Optics.ReadOnly

type MappedOptic A_ReversedPrism 
Instance details

Defined in Optics.Mapping

type ViewResult A_ReversedPrism r 
Instance details

Defined in Optics.View

data A_Setter #

Tag for a setter.

Instances

Instances details
Is A_Traversal A_Setter 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

implies :: forall (p :: Type -> Type -> Type -> Type) r. (Constraints A_Traversal p => r) -> Constraints A_Setter p => r #

Is An_AffineTraversal A_Setter 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

implies :: forall (p :: Type -> Type -> Type -> Type) r. (Constraints An_AffineTraversal p => r) -> Constraints A_Setter p => r #

Is A_Prism A_Setter 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

implies :: forall (p :: Type -> Type -> Type -> Type) r. (Constraints A_Prism p => r) -> Constraints A_Setter p => r #

Is A_Lens A_Setter 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

implies :: forall (p :: Type -> Type -> Type -> Type) r. (Constraints A_Lens p => r) -> Constraints A_Setter p => r #

Is An_Iso A_Setter 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

implies :: forall (p :: Type -> Type -> Type -> Type) r. (Constraints An_Iso p => r) -> Constraints A_Setter p => r #

k ~ A_Setter => JoinKinds A_Setter A_Setter k 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

joinKinds :: forall (p :: Type -> Type -> Type -> Type) r. ((Constraints A_Setter p, Constraints A_Setter p) => r) -> Constraints k p => r #

k ~ A_Setter => JoinKinds A_Setter A_Traversal k 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

joinKinds :: forall (p :: Type -> Type -> Type -> Type) r. ((Constraints A_Setter p, Constraints A_Traversal p) => r) -> Constraints k p => r #

k ~ A_Setter => JoinKinds A_Setter An_AffineTraversal k 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

joinKinds :: forall (p :: Type -> Type -> Type -> Type) r. ((Constraints A_Setter p, Constraints An_AffineTraversal p) => r) -> Constraints k p => r #

k ~ A_Setter => JoinKinds A_Setter A_Prism k 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

joinKinds :: forall (p :: Type -> Type -> Type -> Type) r. ((Constraints A_Setter p, Constraints A_Prism p) => r) -> Constraints k p => r #

k ~ A_Setter => JoinKinds A_Setter A_Lens k 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

joinKinds :: forall (p :: Type -> Type -> Type -> Type) r. ((Constraints A_Setter p, Constraints A_Lens p) => r) -> Constraints k p => r #

k ~ A_Setter => JoinKinds A_Setter An_Iso k 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

joinKinds :: forall (p :: Type -> Type -> Type -> Type) r. ((Constraints A_Setter p, Constraints An_Iso p) => r) -> Constraints k p => r #

k ~ A_Setter => JoinKinds A_Traversal A_Setter k 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

joinKinds :: forall (p :: Type -> Type -> Type -> Type) r. ((Constraints A_Traversal p, Constraints A_Setter p) => r) -> Constraints k p => r #

k ~ A_Setter => JoinKinds An_AffineTraversal A_Setter k 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

joinKinds :: forall (p :: Type -> Type -> Type -> Type) r. ((Constraints An_AffineTraversal p, Constraints A_Setter p) => r) -> Constraints k p => r #

k ~ A_Setter => JoinKinds A_Prism A_Setter k 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

joinKinds :: forall (p :: Type -> Type -> Type -> Type) r. ((Constraints A_Prism p, Constraints A_Setter p) => r) -> Constraints k p => r #

k ~ A_Setter => JoinKinds A_Lens A_Setter k 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

joinKinds :: forall (p :: Type -> Type -> Type -> Type) r. ((Constraints A_Lens p, Constraints A_Setter p) => r) -> Constraints k p => r #

k ~ A_Setter => JoinKinds An_Iso A_Setter k 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

joinKinds :: forall (p :: Type -> Type -> Type -> Type) r. ((Constraints An_Iso p, Constraints A_Setter p) => r) -> Constraints k p => r #

IxOptic A_Setter s t a b 
Instance details

Defined in Optics.Indexed.Core

Methods

noIx :: forall (is :: IxList). NonEmptyIndices is => Optic A_Setter is s t a b -> Optic A_Setter NoIx s t a b #

data A_Traversal #

Tag for a traversal.

Instances

Instances details
Monoid r => ViewableOptic A_Traversal r 
Instance details

Defined in Optics.View

Associated Types

type ViewResult A_Traversal r #

Methods

gview :: forall s m (is :: IxList). MonadReader s m => Optic' A_Traversal is s r -> m (ViewResult A_Traversal r) #

gviews :: forall s m (is :: IxList) a. MonadReader s m => Optic' A_Traversal is s a -> (a -> r) -> m (ViewResult A_Traversal r) #

Is A_Traversal A_Fold 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

implies :: forall (p :: Type -> Type -> Type -> Type) r. (Constraints A_Traversal p => r) -> Constraints A_Fold p => r #

Is A_Traversal A_Setter 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

implies :: forall (p :: Type -> Type -> Type -> Type) r. (Constraints A_Traversal p => r) -> Constraints A_Setter p => r #

Is An_AffineTraversal A_Traversal 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

implies :: forall (p :: Type -> Type -> Type -> Type) r. (Constraints An_AffineTraversal p => r) -> Constraints A_Traversal p => r #

Is A_Prism A_Traversal 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

implies :: forall (p :: Type -> Type -> Type -> Type) r. (Constraints A_Prism p => r) -> Constraints A_Traversal p => r #

Is A_Lens A_Traversal 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

implies :: forall (p :: Type -> Type -> Type -> Type) r. (Constraints A_Lens p => r) -> Constraints A_Traversal p => r #

Is An_Iso A_Traversal 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

implies :: forall (p :: Type -> Type -> Type -> Type) r. (Constraints An_Iso p => r) -> Constraints A_Traversal p => r #

Monoid r => PermeableOptic A_Traversal r 
Instance details

Defined in Optics.Passthrough

Methods

passthrough :: forall (is :: IxList) s t a b. Optic A_Traversal is s t a b -> (a -> (r, b)) -> s -> (ViewResult A_Traversal r, t) #

k ~ A_Fold => JoinKinds A_Fold A_Traversal k 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

joinKinds :: forall (p :: Type -> Type -> Type -> Type) r. ((Constraints A_Fold p, Constraints A_Traversal p) => r) -> Constraints k p => r #

k ~ A_Fold => JoinKinds An_AffineFold A_Traversal k 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

joinKinds :: forall (p :: Type -> Type -> Type -> Type) r. ((Constraints An_AffineFold p, Constraints A_Traversal p) => r) -> Constraints k p => r #

k ~ A_Fold => JoinKinds A_Getter A_Traversal k 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

joinKinds :: forall (p :: Type -> Type -> Type -> Type) r. ((Constraints A_Getter p, Constraints A_Traversal p) => r) -> Constraints k p => r #

k ~ A_Fold => JoinKinds A_ReversedPrism A_Traversal k 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

joinKinds :: forall (p :: Type -> Type -> Type -> Type) r. ((Constraints A_ReversedPrism p, Constraints A_Traversal p) => r) -> Constraints k p => r #

k ~ A_Setter => JoinKinds A_Setter A_Traversal k 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

joinKinds :: forall (p :: Type -> Type -> Type -> Type) r. ((Constraints A_Setter p, Constraints A_Traversal p) => r) -> Constraints k p => r #

k ~ A_Fold => JoinKinds A_Traversal A_Fold k 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

joinKinds :: forall (p :: Type -> Type -> Type -> Type) r. ((Constraints A_Traversal p, Constraints A_Fold p) => r) -> Constraints k p => r #

k ~ A_Fold => JoinKinds A_Traversal An_AffineFold k 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

joinKinds :: forall (p :: Type -> Type -> Type -> Type) r. ((Constraints A_Traversal p, Constraints An_AffineFold p) => r) -> Constraints k p => r #

k ~ A_Fold => JoinKinds A_Traversal A_Getter k 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

joinKinds :: forall (p :: Type -> Type -> Type -> Type) r. ((Constraints A_Traversal p, Constraints A_Getter p) => r) -> Constraints k p => r #

k ~ A_Fold => JoinKinds A_Traversal A_ReversedPrism k 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

joinKinds :: forall (p :: Type -> Type -> Type -> Type) r. ((Constraints A_Traversal p, Constraints A_ReversedPrism p) => r) -> Constraints k p => r #

k ~ A_Setter => JoinKinds A_Traversal A_Setter k 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

joinKinds :: forall (p :: Type -> Type -> Type -> Type) r. ((Constraints A_Traversal p, Constraints A_Setter p) => r) -> Constraints k p => r #

k ~ A_Traversal => JoinKinds A_Traversal A_Traversal k 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

joinKinds :: forall (p :: Type -> Type -> Type -> Type) r. ((Constraints A_Traversal p, Constraints A_Traversal p) => r) -> Constraints k p => r #

k ~ A_Traversal => JoinKinds A_Traversal An_AffineTraversal k 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

joinKinds :: forall (p :: Type -> Type -> Type -> Type) r. ((Constraints A_Traversal p, Constraints An_AffineTraversal p) => r) -> Constraints k p => r #

k ~ A_Traversal => JoinKinds A_Traversal A_Prism k 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

joinKinds :: forall (p :: Type -> Type -> Type -> Type) r. ((Constraints A_Traversal p, Constraints A_Prism p) => r) -> Constraints k p => r #

k ~ A_Traversal => JoinKinds A_Traversal A_Lens k 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

joinKinds :: forall (p :: Type -> Type -> Type -> Type) r. ((Constraints A_Traversal p, Constraints A_Lens p) => r) -> Constraints k p => r #

k ~ A_Traversal => JoinKinds A_Traversal An_Iso k 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

joinKinds :: forall (p :: Type -> Type -> Type -> Type) r. ((Constraints A_Traversal p, Constraints An_Iso p) => r) -> Constraints k p => r #

k ~ A_Traversal => JoinKinds An_AffineTraversal A_Traversal k 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

joinKinds :: forall (p :: Type -> Type -> Type -> Type) r. ((Constraints An_AffineTraversal p, Constraints A_Traversal p) => r) -> Constraints k p => r #

k ~ A_Traversal => JoinKinds A_Prism A_Traversal k 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

joinKinds :: forall (p :: Type -> Type -> Type -> Type) r. ((Constraints A_Prism p, Constraints A_Traversal p) => r) -> Constraints k p => r #

k ~ A_Traversal => JoinKinds A_Lens A_Traversal k 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

joinKinds :: forall (p :: Type -> Type -> Type -> Type) r. ((Constraints A_Lens p, Constraints A_Traversal p) => r) -> Constraints k p => r #

k ~ A_Traversal => JoinKinds An_Iso A_Traversal k 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

joinKinds :: forall (p :: Type -> Type -> Type -> Type) r. ((Constraints An_Iso p, Constraints A_Traversal p) => r) -> Constraints k p => r #

ToReadOnly A_Traversal s t a b 
Instance details

Defined in Optics.ReadOnly

Associated Types

type ReadOnlyOptic A_Traversal #

Methods

getting :: forall (is :: IxList). Optic A_Traversal is s t a b -> Optic' (ReadOnlyOptic A_Traversal) is s a #

IxOptic A_Traversal s t a b 
Instance details

Defined in Optics.Indexed.Core

Methods

noIx :: forall (is :: IxList). NonEmptyIndices is => Optic A_Traversal is s t a b -> Optic A_Traversal NoIx s t a b #

type ReadOnlyOptic A_Traversal 
Instance details

Defined in Optics.ReadOnly

type ViewResult A_Traversal r 
Instance details

Defined in Optics.View

data An_AffineTraversal #

Tag for an affine traversal.

Instances

Instances details
ViewableOptic An_AffineTraversal r 
Instance details

Defined in Optics.View

Associated Types

type ViewResult An_AffineTraversal r #

Methods

gview :: forall s m (is :: IxList). MonadReader s m => Optic' An_AffineTraversal is s r -> m (ViewResult An_AffineTraversal r) #

gviews :: forall s m (is :: IxList) a. MonadReader s m => Optic' An_AffineTraversal is s a -> (a -> r) -> m (ViewResult An_AffineTraversal r) #

Is An_AffineTraversal A_Fold 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

implies :: forall (p :: Type -> Type -> Type -> Type) r. (Constraints An_AffineTraversal p => r) -> Constraints A_Fold p => r #

Is An_AffineTraversal An_AffineFold 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

implies :: forall (p :: Type -> Type -> Type -> Type) r. (Constraints An_AffineTraversal p => r) -> Constraints An_AffineFold p => r #

Is An_AffineTraversal A_Setter 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

implies :: forall (p :: Type -> Type -> Type -> Type) r. (Constraints An_AffineTraversal p => r) -> Constraints A_Setter p => r #

Is An_AffineTraversal A_Traversal 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

implies :: forall (p :: Type -> Type -> Type -> Type) r. (Constraints An_AffineTraversal p => r) -> Constraints A_Traversal p => r #

Is A_Prism An_AffineTraversal 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

implies :: forall (p :: Type -> Type -> Type -> Type) r. (Constraints A_Prism p => r) -> Constraints An_AffineTraversal p => r #

Is A_Lens An_AffineTraversal 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

implies :: forall (p :: Type -> Type -> Type -> Type) r. (Constraints A_Lens p => r) -> Constraints An_AffineTraversal p => r #

Is An_Iso An_AffineTraversal 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

implies :: forall (p :: Type -> Type -> Type -> Type) r. (Constraints An_Iso p => r) -> Constraints An_AffineTraversal p => r #

PermeableOptic An_AffineTraversal r 
Instance details

Defined in Optics.Passthrough

Methods

passthrough :: forall (is :: IxList) s t a b. Optic An_AffineTraversal is s t a b -> (a -> (r, b)) -> s -> (ViewResult An_AffineTraversal r, t) #

k ~ A_Fold => JoinKinds A_Fold An_AffineTraversal k 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

joinKinds :: forall (p :: Type -> Type -> Type -> Type) r. ((Constraints A_Fold p, Constraints An_AffineTraversal p) => r) -> Constraints k p => r #

k ~ An_AffineFold => JoinKinds An_AffineFold An_AffineTraversal k 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

joinKinds :: forall (p :: Type -> Type -> Type -> Type) r. ((Constraints An_AffineFold p, Constraints An_AffineTraversal p) => r) -> Constraints k p => r #

k ~ An_AffineFold => JoinKinds A_Getter An_AffineTraversal k 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

joinKinds :: forall (p :: Type -> Type -> Type -> Type) r. ((Constraints A_Getter p, Constraints An_AffineTraversal p) => r) -> Constraints k p => r #

k ~ An_AffineFold => JoinKinds A_ReversedPrism An_AffineTraversal k 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

joinKinds :: forall (p :: Type -> Type -> Type -> Type) r. ((Constraints A_ReversedPrism p, Constraints An_AffineTraversal p) => r) -> Constraints k p => r #

k ~ A_Setter => JoinKinds A_Setter An_AffineTraversal k 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

joinKinds :: forall (p :: Type -> Type -> Type -> Type) r. ((Constraints A_Setter p, Constraints An_AffineTraversal p) => r) -> Constraints k p => r #

k ~ A_Traversal => JoinKinds A_Traversal An_AffineTraversal k 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

joinKinds :: forall (p :: Type -> Type -> Type -> Type) r. ((Constraints A_Traversal p, Constraints An_AffineTraversal p) => r) -> Constraints k p => r #

k ~ A_Fold => JoinKinds An_AffineTraversal A_Fold k 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

joinKinds :: forall (p :: Type -> Type -> Type -> Type) r. ((Constraints An_AffineTraversal p, Constraints A_Fold p) => r) -> Constraints k p => r #

k ~ An_AffineFold => JoinKinds An_AffineTraversal An_AffineFold k 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

joinKinds :: forall (p :: Type -> Type -> Type -> Type) r. ((Constraints An_AffineTraversal p, Constraints An_AffineFold p) => r) -> Constraints k p => r #

k ~ An_AffineFold => JoinKinds An_AffineTraversal A_Getter k 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

joinKinds :: forall (p :: Type -> Type -> Type -> Type) r. ((Constraints An_AffineTraversal p, Constraints A_Getter p) => r) -> Constraints k p => r #

k ~ An_AffineFold => JoinKinds An_AffineTraversal A_ReversedPrism k 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

joinKinds :: forall (p :: Type -> Type -> Type -> Type) r. ((Constraints An_AffineTraversal p, Constraints A_ReversedPrism p) => r) -> Constraints k p => r #

k ~ A_Setter => JoinKinds An_AffineTraversal A_Setter k 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

joinKinds :: forall (p :: Type -> Type -> Type -> Type) r. ((Constraints An_AffineTraversal p, Constraints A_Setter p) => r) -> Constraints k p => r #

k ~ A_Traversal => JoinKinds An_AffineTraversal A_Traversal k 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

joinKinds :: forall (p :: Type -> Type -> Type -> Type) r. ((Constraints An_AffineTraversal p, Constraints A_Traversal p) => r) -> Constraints k p => r #

k ~ An_AffineTraversal => JoinKinds An_AffineTraversal An_AffineTraversal k 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

joinKinds :: forall (p :: Type -> Type -> Type -> Type) r. ((Constraints An_AffineTraversal p, Constraints An_AffineTraversal p) => r) -> Constraints k p => r #

k ~ An_AffineTraversal => JoinKinds An_AffineTraversal A_Prism k 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

joinKinds :: forall (p :: Type -> Type -> Type -> Type) r. ((Constraints An_AffineTraversal p, Constraints A_Prism p) => r) -> Constraints k p => r #

k ~ An_AffineTraversal => JoinKinds An_AffineTraversal A_Lens k 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

joinKinds :: forall (p :: Type -> Type -> Type -> Type) r. ((Constraints An_AffineTraversal p, Constraints A_Lens p) => r) -> Constraints k p => r #

k ~ An_AffineTraversal => JoinKinds An_AffineTraversal An_Iso k 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

joinKinds :: forall (p :: Type -> Type -> Type -> Type) r. ((Constraints An_AffineTraversal p, Constraints An_Iso p) => r) -> Constraints k p => r #

k ~ An_AffineTraversal => JoinKinds A_Prism An_AffineTraversal k 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

joinKinds :: forall (p :: Type -> Type -> Type -> Type) r. ((Constraints A_Prism p, Constraints An_AffineTraversal p) => r) -> Constraints k p => r #

k ~ An_AffineTraversal => JoinKinds A_Lens An_AffineTraversal k 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

joinKinds :: forall (p :: Type -> Type -> Type -> Type) r. ((Constraints A_Lens p, Constraints An_AffineTraversal p) => r) -> Constraints k p => r #

k ~ An_AffineTraversal => JoinKinds An_Iso An_AffineTraversal k 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

joinKinds :: forall (p :: Type -> Type -> Type -> Type) r. ((Constraints An_Iso p, Constraints An_AffineTraversal p) => r) -> Constraints k p => r #

ToReadOnly An_AffineTraversal s t a b 
Instance details

Defined in Optics.ReadOnly

Associated Types

type ReadOnlyOptic An_AffineTraversal #

Methods

getting :: forall (is :: IxList). Optic An_AffineTraversal is s t a b -> Optic' (ReadOnlyOptic An_AffineTraversal) is s a #

IxOptic An_AffineTraversal s t a b 
Instance details

Defined in Optics.Indexed.Core

Methods

noIx :: forall (is :: IxList). NonEmptyIndices is => Optic An_AffineTraversal is s t a b -> Optic An_AffineTraversal NoIx s t a b #

type ReadOnlyOptic An_AffineTraversal 
Instance details

Defined in Optics.ReadOnly

type ViewResult An_AffineTraversal r 
Instance details

Defined in Optics.View

data A_Prism #

Tag for a prism.

Instances

Instances details
ReversibleOptic A_Prism 
Instance details

Defined in Optics.Re

Associated Types

type ReversedOptic A_Prism = (r :: Type) #

Methods

re :: forall (is :: IxList) s t a b. AcceptsEmptyIndices "re" is => Optic A_Prism is s t a b -> Optic (ReversedOptic A_Prism) is b a t s #

ViewableOptic A_Prism r 
Instance details

Defined in Optics.View

Associated Types

type ViewResult A_Prism r #

Methods

gview :: forall s m (is :: IxList). MonadReader s m => Optic' A_Prism is s r -> m (ViewResult A_Prism r) #

gviews :: forall s m (is :: IxList) a. MonadReader s m => Optic' A_Prism is s a -> (a -> r) -> m (ViewResult A_Prism r) #

Is A_Prism A_Review 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

implies :: forall (p :: Type -> Type -> Type -> Type) r. (Constraints A_Prism p => r) -> Constraints A_Review p => r #

Is A_Prism A_Fold 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

implies :: forall (p :: Type -> Type -> Type -> Type) r. (Constraints A_Prism p => r) -> Constraints A_Fold p => r #

Is A_Prism An_AffineFold 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

implies :: forall (p :: Type -> Type -> Type -> Type) r. (Constraints A_Prism p => r) -> Constraints An_AffineFold p => r #

Is A_Prism A_Setter 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

implies :: forall (p :: Type -> Type -> Type -> Type) r. (Constraints A_Prism p => r) -> Constraints A_Setter p => r #

Is A_Prism A_Traversal 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

implies :: forall (p :: Type -> Type -> Type -> Type) r. (Constraints A_Prism p => r) -> Constraints A_Traversal p => r #

Is A_Prism An_AffineTraversal 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

implies :: forall (p :: Type -> Type -> Type -> Type) r. (Constraints A_Prism p => r) -> Constraints An_AffineTraversal p => r #

Is An_Iso A_Prism 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

implies :: forall (p :: Type -> Type -> Type -> Type) r. (Constraints An_Iso p => r) -> Constraints A_Prism p => r #

PermeableOptic A_Prism r 
Instance details

Defined in Optics.Passthrough

Methods

passthrough :: forall (is :: IxList) s t a b. Optic A_Prism is s t a b -> (a -> (r, b)) -> s -> (ViewResult A_Prism r, t) #

k ~ A_Review => JoinKinds A_Review A_Prism k 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

joinKinds :: forall (p :: Type -> Type -> Type -> Type) r. ((Constraints A_Review p, Constraints A_Prism p) => r) -> Constraints k p => r #

k ~ A_Review => JoinKinds A_ReversedLens A_Prism k 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

joinKinds :: forall (p :: Type -> Type -> Type -> Type) r. ((Constraints A_ReversedLens p, Constraints A_Prism p) => r) -> Constraints k p => r #

k ~ A_Fold => JoinKinds A_Fold A_Prism k 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

joinKinds :: forall (p :: Type -> Type -> Type -> Type) r. ((Constraints A_Fold p, Constraints A_Prism p) => r) -> Constraints k p => r #

k ~ An_AffineFold => JoinKinds An_AffineFold A_Prism k 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

joinKinds :: forall (p :: Type -> Type -> Type -> Type) r. ((Constraints An_AffineFold p, Constraints A_Prism p) => r) -> Constraints k p => r #

k ~ An_AffineFold => JoinKinds A_Getter A_Prism k 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

joinKinds :: forall (p :: Type -> Type -> Type -> Type) r. ((Constraints A_Getter p, Constraints A_Prism p) => r) -> Constraints k p => r #

k ~ An_AffineFold => JoinKinds A_ReversedPrism A_Prism k 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

joinKinds :: forall (p :: Type -> Type -> Type -> Type) r. ((Constraints A_ReversedPrism p, Constraints A_Prism p) => r) -> Constraints k p => r #

k ~ A_Setter => JoinKinds A_Setter A_Prism k 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

joinKinds :: forall (p :: Type -> Type -> Type -> Type) r. ((Constraints A_Setter p, Constraints A_Prism p) => r) -> Constraints k p => r #

k ~ A_Traversal => JoinKinds A_Traversal A_Prism k 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

joinKinds :: forall (p :: Type -> Type -> Type -> Type) r. ((Constraints A_Traversal p, Constraints A_Prism p) => r) -> Constraints k p => r #

k ~ An_AffineTraversal => JoinKinds An_AffineTraversal A_Prism k 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

joinKinds :: forall (p :: Type -> Type -> Type -> Type) r. ((Constraints An_AffineTraversal p, Constraints A_Prism p) => r) -> Constraints k p => r #

k ~ A_Review => JoinKinds A_Prism A_Review k 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

joinKinds :: forall (p :: Type -> Type -> Type -> Type) r. ((Constraints A_Prism p, Constraints A_Review p) => r) -> Constraints k p => r #

k ~ A_Review => JoinKinds A_Prism A_ReversedLens k 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

joinKinds :: forall (p :: Type -> Type -> Type -> Type) r. ((Constraints A_Prism p, Constraints A_ReversedLens p) => r) -> Constraints k p => r #

k ~ A_Fold => JoinKinds A_Prism A_Fold k 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

joinKinds :: forall (p :: Type -> Type -> Type -> Type) r. ((Constraints A_Prism p, Constraints A_Fold p) => r) -> Constraints k p => r #

k ~ An_AffineFold => JoinKinds A_Prism An_AffineFold k 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

joinKinds :: forall (p :: Type -> Type -> Type -> Type) r. ((Constraints A_Prism p, Constraints An_AffineFold p) => r) -> Constraints k p => r #

k ~ An_AffineFold => JoinKinds A_Prism A_Getter k 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

joinKinds :: forall (p :: Type -> Type -> Type -> Type) r. ((Constraints A_Prism p, Constraints A_Getter p) => r) -> Constraints k p => r #

k ~ An_AffineFold => JoinKinds A_Prism A_ReversedPrism k 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

joinKinds :: forall (p :: Type -> Type -> Type -> Type) r. ((Constraints A_Prism p, Constraints A_ReversedPrism p) => r) -> Constraints k p => r #

k ~ A_Setter => JoinKinds A_Prism A_Setter k 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

joinKinds :: forall (p :: Type -> Type -> Type -> Type) r. ((Constraints A_Prism p, Constraints A_Setter p) => r) -> Constraints k p => r #

k ~ A_Traversal => JoinKinds A_Prism A_Traversal k 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

joinKinds :: forall (p :: Type -> Type -> Type -> Type) r. ((Constraints A_Prism p, Constraints A_Traversal p) => r) -> Constraints k p => r #

k ~ An_AffineTraversal => JoinKinds A_Prism An_AffineTraversal k 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

joinKinds :: forall (p :: Type -> Type -> Type -> Type) r. ((Constraints A_Prism p, Constraints An_AffineTraversal p) => r) -> Constraints k p => r #

k ~ A_Prism => JoinKinds A_Prism A_Prism k 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

joinKinds :: forall (p :: Type -> Type -> Type -> Type) r. ((Constraints A_Prism p, Constraints A_Prism p) => r) -> Constraints k p => r #

k ~ An_AffineTraversal => JoinKinds A_Prism A_Lens k 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

joinKinds :: forall (p :: Type -> Type -> Type -> Type) r. ((Constraints A_Prism p, Constraints A_Lens p) => r) -> Constraints k p => r #

k ~ A_Prism => JoinKinds A_Prism An_Iso k 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

joinKinds :: forall (p :: Type -> Type -> Type -> Type) r. ((Constraints A_Prism p, Constraints An_Iso p) => r) -> Constraints k p => r #

k ~ An_AffineTraversal => JoinKinds A_Lens A_Prism k 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

joinKinds :: forall (p :: Type -> Type -> Type -> Type) r. ((Constraints A_Lens p, Constraints A_Prism p) => r) -> Constraints k p => r #

k ~ A_Prism => JoinKinds An_Iso A_Prism k 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

joinKinds :: forall (p :: Type -> Type -> Type -> Type) r. ((Constraints An_Iso p, Constraints A_Prism p) => r) -> Constraints k p => r #

ToReadOnly A_Prism s t a b 
Instance details

Defined in Optics.ReadOnly

Associated Types

type ReadOnlyOptic A_Prism #

Methods

getting :: forall (is :: IxList). Optic A_Prism is s t a b -> Optic' (ReadOnlyOptic A_Prism) is s a #

(Functor f, f ~ g, s ~ t, a ~ b) => MappingOptic A_Prism f g s t a b 
Instance details

Defined in Optics.Mapping

Associated Types

type MappedOptic A_Prism #

Methods

mapping :: forall (is :: IxList). AcceptsEmptyIndices "mapping" is => Optic A_Prism is s t a b -> Optic (MappedOptic A_Prism) is (f s) (g t) (f a) (g b) #

(GConstructorImpl repDefined name s t a b, _name ~ AppendSymbol "_" name) => GenericOptic repDefined (_name :: Symbol) A_Prism s t a b 
Instance details

Defined in Optics.Label

Methods

genericOptic :: Optic A_Prism NoIx s t a b

type ReversedOptic A_Prism 
Instance details

Defined in Optics.Re

type ReadOnlyOptic A_Prism 
Instance details

Defined in Optics.ReadOnly

type MappedOptic A_Prism 
Instance details

Defined in Optics.Mapping

type ViewResult A_Prism r 
Instance details

Defined in Optics.View

data A_Lens #

Tag for a lens.

Instances

Instances details
ReversibleOptic A_Lens 
Instance details

Defined in Optics.Re

Associated Types

type ReversedOptic A_Lens = (r :: Type) #

Methods

re :: forall (is :: IxList) s t a b. AcceptsEmptyIndices "re" is => Optic A_Lens is s t a b -> Optic (ReversedOptic A_Lens) is b a t s #

ViewableOptic A_Lens r 
Instance details

Defined in Optics.View

Associated Types

type ViewResult A_Lens r #

Methods

gview :: forall s m (is :: IxList). MonadReader s m => Optic' A_Lens is s r -> m (ViewResult A_Lens r) #

gviews :: forall s m (is :: IxList) a. MonadReader s m => Optic' A_Lens is s a -> (a -> r) -> m (ViewResult A_Lens r) #

Is A_Lens A_Fold 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

implies :: forall (p :: Type -> Type -> Type -> Type) r. (Constraints A_Lens p => r) -> Constraints A_Fold p => r #

Is A_Lens An_AffineFold 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

implies :: forall (p :: Type -> Type -> Type -> Type) r. (Constraints A_Lens p => r) -> Constraints An_AffineFold p => r #

Is A_Lens A_Getter 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

implies :: forall (p :: Type -> Type -> Type -> Type) r. (Constraints A_Lens p => r) -> Constraints A_Getter p => r #

Is A_Lens A_Setter 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

implies :: forall (p :: Type -> Type -> Type -> Type) r. (Constraints A_Lens p => r) -> Constraints A_Setter p => r #

Is A_Lens A_Traversal 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

implies :: forall (p :: Type -> Type -> Type -> Type) r. (Constraints A_Lens p => r) -> Constraints A_Traversal p => r #

Is A_Lens An_AffineTraversal 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

implies :: forall (p :: Type -> Type -> Type -> Type) r. (Constraints A_Lens p => r) -> Constraints An_AffineTraversal p => r #

Is An_Iso A_Lens 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

implies :: forall (p :: Type -> Type -> Type -> Type) r. (Constraints An_Iso p => r) -> Constraints A_Lens p => r #

PermeableOptic A_Lens r 
Instance details

Defined in Optics.Passthrough

Methods

passthrough :: forall (is :: IxList) s t a b. Optic A_Lens is s t a b -> (a -> (r, b)) -> s -> (ViewResult A_Lens r, t) #

k ~ A_Fold => JoinKinds A_Fold A_Lens k 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

joinKinds :: forall (p :: Type -> Type -> Type -> Type) r. ((Constraints A_Fold p, Constraints A_Lens p) => r) -> Constraints k p => r #

k ~ An_AffineFold => JoinKinds An_AffineFold A_Lens k 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

joinKinds :: forall (p :: Type -> Type -> Type -> Type) r. ((Constraints An_AffineFold p, Constraints A_Lens p) => r) -> Constraints k p => r #

k ~ A_Getter => JoinKinds A_Getter A_Lens k 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

joinKinds :: forall (p :: Type -> Type -> Type -> Type) r. ((Constraints A_Getter p, Constraints A_Lens p) => r) -> Constraints k p => r #

k ~ A_Getter => JoinKinds A_ReversedPrism A_Lens k 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

joinKinds :: forall (p :: Type -> Type -> Type -> Type) r. ((Constraints A_ReversedPrism p, Constraints A_Lens p) => r) -> Constraints k p => r #

k ~ A_Setter => JoinKinds A_Setter A_Lens k 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

joinKinds :: forall (p :: Type -> Type -> Type -> Type) r. ((Constraints A_Setter p, Constraints A_Lens p) => r) -> Constraints k p => r #

k ~ A_Traversal => JoinKinds A_Traversal A_Lens k 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

joinKinds :: forall (p :: Type -> Type -> Type -> Type) r. ((Constraints A_Traversal p, Constraints A_Lens p) => r) -> Constraints k p => r #

k ~ An_AffineTraversal => JoinKinds An_AffineTraversal A_Lens k 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

joinKinds :: forall (p :: Type -> Type -> Type -> Type) r. ((Constraints An_AffineTraversal p, Constraints A_Lens p) => r) -> Constraints k p => r #

k ~ An_AffineTraversal => JoinKinds A_Prism A_Lens k 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

joinKinds :: forall (p :: Type -> Type -> Type -> Type) r. ((Constraints A_Prism p, Constraints A_Lens p) => r) -> Constraints k p => r #

k ~ A_Fold => JoinKinds A_Lens A_Fold k 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

joinKinds :: forall (p :: Type -> Type -> Type -> Type) r. ((Constraints A_Lens p, Constraints A_Fold p) => r) -> Constraints k p => r #

k ~ An_AffineFold => JoinKinds A_Lens An_AffineFold k 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

joinKinds :: forall (p :: Type -> Type -> Type -> Type) r. ((Constraints A_Lens p, Constraints An_AffineFold p) => r) -> Constraints k p => r #

k ~ A_Getter => JoinKinds A_Lens A_Getter k 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

joinKinds :: forall (p :: Type -> Type -> Type -> Type) r. ((Constraints A_Lens p, Constraints A_Getter p) => r) ->