optics-core-0.1

Safe HaskellNone
LanguageHaskell2010

Optics.Traversal

Contents

Synopsis

Formation

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 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.

elementsOf :: Traversal s t a a -> (Int -> Bool) -> Traversal s t a a #

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