lens-3.6.0.3: Lenses, Folds and Traversals

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

Data.Sequence.Lens

Description

 

Synopsis

Documentation

ordinal :: 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 already 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

_head :: SimpleIndexedTraversal Int (Seq a) aSource

Traverse the head of a Seq

_tail :: SimpleTraversal (Seq a) (Seq a)Source

Traverse the tail of a Seq

_last :: SimpleIndexedTraversal Int (Seq a) aSource

Traverse the last element of a Seq

_init :: SimpleTraversal (Seq a) (Seq a)Source

Traverse all but the last element of a Seq

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

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

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

Traverse the first n elements of a Seq

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

Traverse all but the first n elements of a Seq