Modulelens-5.3.5Haskell2010
Data.Sequence.Lens
- 6 values
- Packagelens-5.3.5
- Exports6
- LanguageHaskell2010
- LicenceBSD-2-Clause
- SourceLens.hs
Traverse all the elements numbered from i to j of a Seq
Seq.fromList [a,b,c,d,e] & sliced 1 3 %~ ffromList [a,f b,f c,d,e]
Traverse the first n elements of a Seq
Seq.fromList [a,b,c,d,e] ^.. slicedTo 2[a,b]
Seq.fromList [a,b,c,d,e] & slicedTo 2 %~ ffromList [f a,f b,c,d,e]
Seq.fromList [a,b,c,d,e] & slicedTo 10 .~ xfromList [x,x,x,x,x]
Traverse all but the first n elements of a Seq
Seq.fromList [a,b,c,d,e] ^.. slicedFrom 2[c,d,e]
Seq.fromList [a,b,c,d,e] & slicedFrom 2 %~ ffromList [a,b,f c,f d,f e]
Seq.fromList [a,b,c,d,e] & slicedFrom 10 .~ xfromList [a,b,c,d,e]
Construct a Seq from a Getter, Fold, Control.Lens.Traversal.Traversal, Control.Lens.Lens.Lens or Control.Lens.Iso.Iso.
seqOf folded ["hello","world"]fromList ["hello","world"]
seqOf (folded._2) [("hello",1),("world",2),("!!!",3)]fromList [1,2,3]
seqOf :: Getter s a -> s -> Seq a
seqOf :: Fold s a -> s -> Seq a
seqOf :: Iso' s a -> s -> Seq a
seqOf :: Lens' s a -> s -> Seq a
seqOf :: Traversal' s a -> s -> Seq a