Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- 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.
Instances
Functor Seq2 Source # | |
Foldable Seq2 Source # | |
Defined in Data.Seq2 fold :: Monoid m => Seq2 m -> m # foldMap :: Monoid m => (a -> m) -> Seq2 a -> m # foldr :: (a -> b -> b) -> b -> Seq2 a -> b # foldr' :: (a -> b -> b) -> b -> Seq2 a -> b # foldl :: (b -> a -> b) -> b -> Seq2 a -> b # foldl' :: (b -> a -> b) -> b -> Seq2 a -> b # foldr1 :: (a -> a -> a) -> Seq2 a -> a # foldl1 :: (a -> a -> a) -> Seq2 a -> a # elem :: Eq a => a -> Seq2 a -> Bool # maximum :: Ord a => Seq2 a -> a # | |
Traversable Seq2 Source # | |
Eq a => Eq (Seq2 a) Source # | |
Ord a => Ord (Seq2 a) Source # | |
Show a => Show (Seq2 a) Source # | |
Semigroup (Seq2 a) Source # | |
Arbitrary a => Arbitrary (Seq2 a) # | |
Ixed (Seq2 a) Source # | |
type Index (Seq2 a) Source # | |
type IxValue (Seq2 a) Source # | |
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
Instances
Functor ViewL2 Source # | |
Foldable ViewL2 Source # | |
Defined in Data.Seq2 fold :: Monoid m => ViewL2 m -> m # foldMap :: Monoid m => (a -> m) -> ViewL2 a -> m # foldr :: (a -> b -> b) -> b -> ViewL2 a -> b # foldr' :: (a -> b -> b) -> b -> ViewL2 a -> b # foldl :: (b -> a -> b) -> b -> ViewL2 a -> b # foldl' :: (b -> a -> b) -> b -> ViewL2 a -> b # foldr1 :: (a -> a -> a) -> ViewL2 a -> a # foldl1 :: (a -> a -> a) -> ViewL2 a -> a # elem :: Eq a => a -> ViewL2 a -> Bool # maximum :: Ord a => ViewL2 a -> a # minimum :: Ord a => ViewL2 a -> a # | |
Traversable ViewL2 Source # | At least two elements |
Eq a => Eq (ViewL2 a) Source # | |
Ord a => Ord (ViewL2 a) Source # | |
Show a => Show (ViewL2 a) Source # | |
At least one element
Instances
Functor ViewL1 Source # | |
Foldable ViewL1 Source # | |
Defined in Data.Seq2 fold :: Monoid m => ViewL1 m -> m # foldMap :: Monoid m => (a -> m) -> ViewL1 a -> m # foldr :: (a -> b -> b) -> b -> ViewL1 a -> b # foldr' :: (a -> b -> b) -> b -> ViewL1 a -> b # foldl :: (b -> a -> b) -> b -> ViewL1 a -> b # foldl' :: (b -> a -> b) -> b -> ViewL1 a -> b # foldr1 :: (a -> a -> a) -> ViewL1 a -> a # foldl1 :: (a -> a -> a) -> ViewL1 a -> a # elem :: Eq a => a -> ViewL1 a -> Bool # maximum :: Ord a => ViewL1 a -> a # minimum :: Ord a => ViewL1 a -> a # | |
Traversable ViewL1 Source # | |
Eq a => Eq (ViewL1 a) Source # | |
Ord a => Ord (ViewL1 a) Source # | |
Show a => Show (ViewL1 a) Source # | |
Semigroup (ViewL1 a) Source # | We throw away information here; namely that the combined list contains two elements. |
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
Instances
Functor ViewR2 Source # | |
Foldable ViewR2 Source # | |
Defined in Data.Seq2 fold :: Monoid m => ViewR2 m -> m # foldMap :: Monoid m => (a -> m) -> ViewR2 a -> m # foldr :: (a -> b -> b) -> b -> ViewR2 a -> b # foldr' :: (a -> b -> b) -> b -> ViewR2 a -> b # foldl :: (b -> a -> b) -> b -> ViewR2 a -> b # foldl' :: (b -> a -> b) -> b -> ViewR2 a -> b # foldr1 :: (a -> a -> a) -> ViewR2 a -> a # foldl1 :: (a -> a -> a) -> ViewR2 a -> a # elem :: Eq a => a -> ViewR2 a -> Bool # maximum :: Ord a => ViewR2 a -> a # minimum :: Ord a => ViewR2 a -> a # | |
Traversable ViewR2 Source # | |
Eq a => Eq (ViewR2 a) Source # | |
Ord a => Ord (ViewR2 a) Source # | |
Show a => Show (ViewR2 a) Source # | |
A view of the right end of the sequence, with the guarantee that it has at least one element.
Instances
Functor ViewR1 Source # | |
Foldable ViewR1 Source # | |
Defined in Data.Seq2 fold :: Monoid m => ViewR1 m -> m # foldMap :: Monoid m => (a -> m) -> ViewR1 a -> m # foldr :: (a -> b -> b) -> b -> ViewR1 a -> b # foldr' :: (a -> b -> b) -> b -> ViewR1 a -> b # foldl :: (b -> a -> b) -> b -> ViewR1 a -> b # foldl' :: (b -> a -> b) -> b -> ViewR1 a -> b # foldr1 :: (a -> a -> a) -> ViewR1 a -> a # foldl1 :: (a -> a -> a) -> ViewR1 a -> a # elem :: Eq a => a -> ViewR1 a -> Bool # maximum :: Ord a => ViewR1 a -> a # minimum :: Ord a => ViewR1 a -> a # | |
Traversable ViewR1 Source # | |
Eq a => Eq (ViewR1 a) Source # | |
Ord a => Ord (ViewR1 a) Source # | |
Read a => Read (ViewR1 a) Source # | |
Show a => Show (ViewR1 a) Source # | |
r1Singleton :: a -> ViewR1 a Source #