lens-2.2: Lenses, Folds and Traversals

Portabilityportable
Stabilityprovisional
MaintainerEdward Kmett <ekmett@gmail.com>
Safe HaskellSafe-Infered

Data.Sequence.Lens

Description

 

Synopsis

Documentation

at :: Int -> SimpleIndexedLens Int (Seq a) aSource

A Lens that can access the nth element of a Seq.

Note: This is only a legal lens if there is such an element!

viewL :: Iso (Seq a) (Seq b) (ViewL a) (ViewL b)Source

A Seq is isomorphic to a ViewL

 viewl m = m^.viewL

viewR :: Iso (Seq a) (Seq b) (ViewR a) (ViewR b)Source

A Seq is isomorphic to a ViewR

 viewr m = m^.viewR

traverseHead :: SimpleIndexedTraversal Int (Seq a) aSource

Traverse the head of a Seq

traverseTail :: SimpleIndexedTraversal Int (Seq a) aSource

Traverse the tail of a Seq

traverseLast :: SimpleIndexedTraversal Int (Seq a) aSource

Traverse the last element of a Seq

traverseInit :: SimpleIndexedTraversal Int (Seq a) aSource

Traverse all but the last element of a Seq

traverseTo :: Int -> SimpleIndexedTraversal Int (Seq a) aSource

Traverse the first n elements of a Seq

traverseFrom :: Int -> SimpleIndexedTraversal Int (Seq a) aSource

Traverse all but the first n elements of a Seq

traverseSlice :: Int -> Int -> SimpleIndexedTraversal Int (Seq a) aSource

Travere all the elements numbered from i to j of a Seq