Safe Haskell | None |
---|---|
Language | Haskell2010 |
- data Seq2 a = Seq2 a (Seq a) a
- duo :: a -> a -> Seq2 a
- index :: Seq2 a -> Int -> a
- adjust :: (a -> a) -> Int -> Seq2 a -> Seq2 a
- partition :: (a -> Bool) -> Seq2 a -> (Seq a, Seq a)
- (<|) :: a -> Seq2 a -> Seq2 a
- (|>) :: Seq2 a -> a -> Seq2 a
- (><) :: Seq2 a -> Seq2 a -> Seq2 a
- fromList :: [a] -> Seq2 a
- mapWithIndex :: (Int -> a -> b) -> Seq2 a -> Seq2 b
- take :: Int -> Seq2 a -> Seq a
- drop :: Int -> Seq2 a -> Seq a
- toSeq :: Seq2 a -> Seq a
- fromSeqUnsafe :: Seq a -> Seq2 a
- data ViewL2 a = a :<< (ViewR1 a)
- data ViewL1 a = a :< (Seq a)
- headL1 :: Lens' (ViewL1 a) a
- toNonEmpty :: ViewL1 a -> NonEmpty a
- viewL1FromNonEmpty :: NonEmpty a -> ViewL1 a
- viewL1FromSeq :: Seq a -> ViewL1 a
- viewl :: Seq2 a -> ViewL2 a
- l1Singleton :: a -> ViewL1 a
- viewL1toR1 :: ViewL1 a -> ViewR1 a
- data ViewR2 a = (ViewL1 a) :>> a
- data ViewR1 a = (Seq a) :> a
- viewr :: Seq2 a -> ViewR2 a
- r1Singleton :: a -> ViewR1 a
Documentation
Basically Data.Sequence but with the guarantee that the list contains at least two elements.
index :: Seq2 a -> Int -> a Source #
get the element with index i, counting from the left and starting at 0. O(log(min(i,n-i)))
fromSeqUnsafe :: Seq a -> Seq2 a Source #
Convert a Seq into a Seq2. It is not checked that the length is at least two
Left views
At least one element
toNonEmpty :: ViewL1 a -> NonEmpty a Source #
viewL1FromNonEmpty :: NonEmpty a -> ViewL1 a Source #
viewL1FromSeq :: Seq a -> ViewL1 a Source #
l1Singleton :: a -> ViewL1 a Source #
viewL1toR1 :: ViewL1 a -> ViewR1 a Source #
Right views
A view of the right end of the seq, with the guarantee that it has at least two elements
A view of the right end of the sequence, with the guarantee that it has at least one element.
r1Singleton :: a -> ViewR1 a Source #