Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- data A_Traversal :: OpticKind
- type Traversal s t a b = Optic A_Traversal '[] s t a b
- type Traversal' s a = Optic' A_Traversal '[] s a
- traversed :: Traversable t => Traversal (t a) (t b) a b
- toTraversal :: Is k A_Traversal => Optic k is s t a b -> Optic A_Traversal is s t a b
- traverseOf :: (Is k A_Traversal, Applicative f) => Optic k is s t a b -> (a -> f b) -> s -> f t
- elementsOf :: Traversal s t a a -> (Int -> Bool) -> Traversal s t a a
- type TraversalVL s t a b = forall f. Applicative f => (a -> f b) -> s -> f t
- type TraversalVL' s a = TraversalVL s s a a
- traversalVL :: TraversalVL s t a b -> Traversal s t a b
- module Optics.Optic
Formation
data A_Traversal :: OpticKind #
Tag for a traversal.
Instances
type Traversal s t a b = Optic A_Traversal '[] s t a b #
Type synonym for a type-modifying traversal.
type Traversal' s a = Optic' A_Traversal '[] s a #
Type synonym for a type-preserving traversal.
Introduction
traversed :: Traversable t => Traversal (t a) (t b) a b #
Traversal via the Traversable
class.
toTraversal :: Is k A_Traversal => Optic k is s t a b -> Optic A_Traversal is s t a b #
Explicitly cast an optic to a traversal.
Elimination
traverseOf :: (Is k A_Traversal, Applicative f) => Optic k is s t a b -> (a -> f b) -> s -> f t #
Map each element of a structure targeted by a Traversal
, evaluate these
actions from left to right, and collect the results.
van Laarhoven encoding
type TraversalVL s t a b = forall f. Applicative f => (a -> f b) -> s -> f t #
Type synonym for a type-modifying van Laarhoven traversal.
type TraversalVL' s a = TraversalVL s s a a #
Type synonym for a type-preserving van Laarhoven traversal.
traversalVL :: TraversalVL s t a b -> Traversal s t a b #
Build a traversal from the van Laarhoven representation.
Re-exports
module Optics.Optic