Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- data A_Traversal :: OpticKind
- type IxTraversal i s t a b = Optic A_Traversal '[i] s t a b
- type IxTraversal' i s a = Optic' A_Traversal '[i] s a
- class (FoldableWithIndex i t, Traversable t) => TraversableWithIndex i t | t -> i where
- toIxTraversal :: Is k A_Traversal => Optic k '[i] s t a b -> IxTraversal i s t a b
- vlIxTraversal :: (forall f. Applicative f => (i -> a -> f b) -> s -> f t) -> IxTraversal i s t a b
- itraversed :: TraversableWithIndex i t => IxTraversal i (t a) (t b) a b
- 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
- module Optics.Optic
Documentation
data A_Traversal :: OpticKind #
Tag for a traversal.
Instances
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 #
itraverse :: Applicative f => (i -> a -> f b) -> t a -> f (t b) #
Instances
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 #
module Optics.Optic