Sequence
Types
Functions
The empty sequence. O(1)
A sequence with a single element. O(1)
Create a sequence from a list. O(n)
Create a sequence of given length from a function. O(n)
Create a sequence of n copies of an element. O(n)
Applicative replicate
Monadic replicate
Is the sequence empty? O(1)
The number of elements in the sequence. O(1)
View from the left. O(1) amortized
View from the right. O(1) amortized
Safe indexing. O(log(min(i, n-i)))
Infix safe indexing
Unsafe indexing. O(log(min(i, n-i)))
Adjust element at index. O(log(min(i, n-i)))
Strict adjust
Take first n elements. O(log(min(n, size-n)))
Drop first n elements. O(log(min(n, size-n)))
Split at index. O(log(min(i, n-i)))
Insert element at index. O(log(min(i, n-i)))
Delete element at index. O(log(min(i, n-i)))
Index of first occurrence from left
All indices of element from left
Index of first occurrence from right
All indices of element from right
Find first index satisfying predicate from left
Find all indices satisfying predicate from left
Find first index satisfying predicate from right
Find all indices satisfying predicate from right
Reverse a sequence. O(n)
Intersperse an element between elements. O(n)
Left scan. O(n)
Left scan without starting value. O(n)
Right scan. O(n)
Right scan without starting value. O(n)
Stable sort. O(n log n)
Stable sort with custom comparison. O(n log n)
Stable sort on projection. O(n log n)
Unstable sort (potentially faster). O(n log n)
Unstable sort with custom comparison. O(n log n)
Unstable sort on projection. O(n log n)
All suffixes. O(n)
All prefixes. O(n)
Split into chunks of given size. O(n)
Take elements from left while predicate holds. O(i)
Take elements from right while predicate holds. O(i)
Drop elements from left while predicate holds. O(i)
Drop elements from right while predicate holds. O(i)
Span from left. O(i)
Span from right. O(i)
Break from left. O(i)
Break from right. O(i)
Partition by predicate. O(n)
Filter elements. O(n)
Zip two sequences. O(min(n, m))
Zip three sequences. O(min(n, m, o))
Zip four sequences. O(min lengths)
Unzip a sequence of pairs. O(n)
Unzip with function. O(n)
Fold with index. O(n)
Left fold with index. O(n)
Right fold with index. O(n)
Traverse with index. O(n)
Map with index. O(n)
addDigits1 :: (Seq (Node (Node a))) -> (Digit (Node a)) -> (Node a) -> (Digit (Node a)) -> (Seq (Node (Node a))) -> Seq (Node (Node a))
#
traverseMiddleWithIndex :: (Applicative f) => (Int -> a -> f b) -> Int -> (Seq (Node a)) -> f (Seq (Node b))
#
traverseDigitNWithIndex :: (Applicative f) => (Int -> a -> f b) -> Int -> (Digit (Node a)) -> f (Digit (Node b))
#