| Copyright | (C) 2012-16 Edward Kmett | 
|---|---|
| License | BSD-style (see the file LICENSE) | 
| Maintainer | Edward Kmett <ekmett@gmail.com> | 
| Stability | experimental | 
| Portability | non-portable | 
| Safe Haskell | Safe-Inferred | 
| Language | Haskell2010 | 
Data.Sequence.Lens
Description
Synopsis
- viewL :: forall a b p f. (Profunctor p, Functor f) => p (ViewL a) (f (ViewL b)) -> p (Seq a) (f (Seq b))
 - viewR :: forall a b p f. (Profunctor p, Functor f) => p (ViewR a) (f (ViewR b)) -> p (Seq a) (f (Seq 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
viewL :: forall a b p f. (Profunctor p, Functor f) => p (ViewL a) (f (ViewL b)) -> p (Seq a) (f (Seq b)) Source #
viewR :: forall a b p f. (Profunctor p, Functor f) => p (ViewR a) (f (ViewR b)) -> p (Seq a) (f (Seq b)) Source #
sliced :: Int -> Int -> IndexedTraversal' Int (Seq a) a Source #
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]
slicedTo :: Int -> IndexedTraversal' Int (Seq a) a Source #
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]
slicedFrom :: Int -> IndexedTraversal' Int (Seq a) a Source #
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]
seqOf :: Getting (Seq a) s a -> s -> Seq a Source #
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