optics-core-0.1

Safe HaskellNone
LanguageHaskell2010

Optics.IxTraversal

Synopsis

Documentation

data A_Traversal :: OpticKind #

Tag for a traversal.

Instances
UnindexableOptic A_Traversal # 
Instance details

Defined in Optics.Unindexed

Methods

unIx :: CheckIndices i is => Optic A_Traversal is s t a b -> Optic A_Traversal [] s t a b #

Is A_Traversal A_Fold # 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

implies :: proxy A_Traversal A_Fold p -> (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 :: proxy A_Traversal A_Setter p -> (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 :: proxy An_AffineTraversal A_Traversal p -> (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 :: proxy A_Prism A_Traversal p -> (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 :: proxy A_Lens A_Traversal p -> (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 :: proxy An_Iso A_Traversal p -> (Constraints An_Iso p -> r) -> Constraints A_Traversal p -> r

Is An_Equality A_Traversal # 
Instance details

Defined in Optics.Internal.Optic.Subtyping

Methods

implies :: proxy An_Equality A_Traversal p -> (Constraints An_Equality p -> r) -> Constraints A_Traversal p -> r

Monoid r => ViewableOptic A_Traversal r # 
Instance details

Defined in Optics.Internal.View

Associated Types

type ViewResult A_Traversal r :: * #

Methods

view :: Optic' A_Traversal is s r -> s -> ViewResult A_Traversal r #

Monoid r => PermeableOptic A_Traversal r # 
Instance details

Defined in Optics.Internal.Passthrough

Methods

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

type ViewResult A_Traversal r # 
Instance details

Defined in Optics.Internal.View

type IxTraversal i s t a b = Optic A_Traversal '[i] s t a b #

Type synonym for a type-modifying indexed traversal.

type IxTraversal' i s a = Optic' A_Traversal '[i] s a #

Type synonym for a type-preserving indexed traversal.

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

Minimal complete definition

itraverse

Methods

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

Instances
TraversableWithIndex Int [] # 
Instance details

Defined in Optics.Internal.Indexed

Methods

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

TraversableWithIndex Int ZipList # 
Instance details

Defined in Optics.Internal.Indexed

Methods

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

TraversableWithIndex Int NonEmpty # 
Instance details

Defined in Optics.Internal.Indexed

Methods

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

TraversableWithIndex Int IntMap # 
Instance details

Defined in Optics.Internal.Indexed

Methods

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

TraversableWithIndex Int Seq # 
Instance details

Defined in Optics.Internal.Indexed

Methods

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

TraversableWithIndex () Maybe # 
Instance details

Defined in Optics.Internal.Indexed

Methods

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

TraversableWithIndex () Par1 # 
Instance details

Defined in Optics.Internal.Indexed

Methods

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

TraversableWithIndex () Identity # 
Instance details

Defined in Optics.Internal.Indexed

Methods

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

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

Defined in Optics.Internal.Indexed

Methods

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

TraversableWithIndex k (Map k) # 
Instance details

Defined in Optics.Internal.Indexed

Methods

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

TraversableWithIndex k ((,) k) # 
Instance details

Defined in Optics.Internal.Indexed

Methods

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

TraversableWithIndex Void (V1 :: * -> *) # 
Instance details

Defined in Optics.Internal.Indexed

Methods

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

TraversableWithIndex Void (U1 :: * -> *) # 
Instance details

Defined in Optics.Internal.Indexed

Methods

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

TraversableWithIndex Void (Proxy :: * -> *) # 
Instance details

Defined in Optics.Internal.Indexed

Methods

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

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

Defined in Optics.Internal.Indexed

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 Optics.Internal.Indexed

Methods

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

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

Defined in Optics.Internal.Indexed

Methods

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

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

Defined in Optics.Internal.Indexed

Methods

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

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

Defined in Optics.Internal.Indexed

Methods

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

TraversableWithIndex [Int] Tree # 
Instance details

Defined in Optics.Internal.Indexed

Methods

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

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

Defined in Optics.Internal.Indexed

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 Optics.Internal.Indexed

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) (Product f g) # 
Instance details

Defined in Optics.Internal.Indexed

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) (Sum f g) # 
Instance details

Defined in Optics.Internal.Indexed

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 (i, j) (f :.: g) # 
Instance details

Defined in Optics.Internal.Indexed

Methods

itraverse :: Applicative f0 => ((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 Optics.Internal.Indexed

Methods

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

toIxTraversal :: Is k A_Traversal => Optic k '[i] s t a b -> IxTraversal i s t a b #

Explicitly cast an optic to an indexed traversal.

vlIxTraversal :: (forall f. Applicative f => (i -> a -> f b) -> s -> f t) -> IxTraversal i s t a b #

Build an indexed traversal from the van Laarhoven representation.

itraversed :: TraversableWithIndex i t => IxTraversal i (t a) (t b) a b #

Indexed traversal via the TraversableWithIndex class.

>>> iover (icompose (,) $ itraversed % itraversed) (,) ["ab", "cd"]
[[((0,0),'a'),((0,1),'b')],[((1,0),'c'),((1,1),'d')]]

itraverseOf :: (CheckIndices i is, Is k A_Traversal) => Optic k is s t a b -> forall f. Applicative f => (i -> a -> f b) -> s -> f t #