| Portability | non-portable |
|---|---|
| Stability | experimental |
| Maintainer | Edward Kmett <ekmett@gmail.com> |
| Safe Haskell | Safe-Inferred |
Data.Sequence.Lens
Description
- viewL :: Iso (Seq a) (Seq b) (ViewL a) (ViewL b)
- viewR :: Iso (Seq a) (Seq b) (ViewR a) (ViewR b)
- sliced :: Int -> Int -> IndexedTraversal' Int (Seq a) a
- slicedTo :: Int -> IndexedTraversal' Int (Seq a) a
- slicedFrom :: Int -> IndexedTraversal' Int (Seq a) a
- seqOf :: Getting (Seq a) s a -> s -> Seq a
Documentation
sliced :: Int -> Int -> IndexedTraversal' Int (Seq a) aSource
Traverse all the elements numbered from i to j of a Seq
>>>fromList [a,b,c,d,e] & sliced 1 3 %~ ffromList [a,f b,f c,d,e]
slicedTo :: Int -> IndexedTraversal' Int (Seq a) aSource
Traverse the first n elements of a Seq
>>>fromList [a,b,c,d,e] ^.. slicedTo 2[a,b]
>>>fromList [a,b,c,d,e] & slicedTo 2 %~ ffromList [f a,f b,c,d,e]
>>>fromList [a,b,c,d,e] & slicedTo 10 .~ xfromList [x,x,x,x,x]
slicedFrom :: Int -> IndexedTraversal' Int (Seq a) aSource
Traverse all but the first n elements of a Seq
>>>fromList [a,b,c,d,e] ^.. slicedFrom 2[c,d,e]
>>>fromList [a,b,c,d,e] & slicedFrom 2 %~ ffromList [a,b,f c,f d,f e]
>>>fromList [a,b,c,d,e] & slicedFrom 10 .~ xfromList [a,b,c,d,e]
seqOf :: Getting (Seq a) s a -> s -> Seq aSource
Construct a Seq from a Getter, Fold, Traversal, Lens or Iso.
>>>seqOf folded ["hello","world"]fromList ["hello","world"]
>>>seqOf (folded._2) [("hello",1),("world",2),("!!!",3)]fromList [1,2,3]
seqOf::Getters a -> s ->SeqaseqOf::Folds a -> s ->SeqaseqOf::Iso's a -> s ->SeqaseqOf::Lens's a -> s ->SeqaseqOf::Traversal's a -> s ->Seqa