Safe Haskell | None |
---|---|
Language | Haskell2010 |
- cons :: MonadRandom m => a -> Tree a -> m (Tree a)
- snoc :: MonadRandom m => Tree a -> a -> m (Tree a)
- append :: MonadRandom m => Tree a -> Tree a -> m (Tree a)
- replicate :: MonadRandom m => Int -> a -> m (Tree a)
- tails :: MonadRandom m => Tree a -> m (Tree (Tree a))
- tailsWith :: MonadRandom m => (Tree a -> m b) -> Tree a -> m (Tree b)
- tailsWith' :: Applicative m => (Tree a -> m b) -> Tree a -> m (Tree b)
- takeWhileL :: (a -> Bool) -> Tree a -> Tree a
- takeWhileR :: (a -> Bool) -> Tree a -> Tree a
- dropWhileL :: (a -> Bool) -> Tree a -> Tree a
- dropWhileR :: (a -> Bool) -> Tree a -> Tree a
- spanL :: (a -> Bool) -> Tree a -> (Tree a, Tree a)
- spanR :: (a -> Bool) -> Tree a -> (Tree a, Tree a)
- breakL :: (a -> Bool) -> Tree a -> (Tree a, Tree a)
- breakR :: (a -> Bool) -> Tree a -> (Tree a, Tree a)
- partition :: (a -> Bool) -> Tree a -> (Tree a, Tree a)
- partition' :: (a -> Bool) -> Tree a -> (TList a, TList a)
- partition'' :: (a -> Bool) -> Lev -> Tree a -> (TList a, TList a) -> (TList a, TList a)
- filter :: (a -> Bool) -> Tree a -> Tree a
- lookup :: Int -> Tree a -> Maybe a
- (!?) :: Tree a -> Int -> Maybe a
- index :: Tree a -> Int -> a
- adjust :: (a -> a) -> Int -> Tree a -> Tree a
- adjust' :: (a -> a) -> Int -> Tree a -> Tree a
- update :: Int -> a -> Tree a -> Tree a
- checked :: Int -> (Tree a -> b) -> b -> Tree a -> b
- take :: Int -> Tree a -> Tree a
- drop :: Int -> Tree a -> Tree a
- insertAt :: MonadRandom m => Int -> a -> Tree a -> m (Tree a)
- deleteAt :: Int -> Tree a -> Tree a
- splitAt :: Int -> Tree a -> (Tree a, Tree a)
- elemIndexL :: Eq a => a -> Tree a -> Maybe Int
- elemIndicesL :: Eq a => a -> Tree a -> [Int]
- elemIndexR :: Eq a => a -> Tree a -> Maybe Int
- elemIndicesR :: Eq a => a -> Tree a -> [Int]
- findIndexL :: (a -> Bool) -> Tree a -> Maybe Int
- findIndicesL :: (a -> Bool) -> Tree a -> [Int]
- findIndicesL' :: Int -> (a -> Bool) -> Tree a -> [Int] -> [Int]
- findIndexR :: (a -> Bool) -> Tree a -> Maybe Int
- findIndicesR :: (a -> Bool) -> Tree a -> [Int]
- findIndicesR' :: Int -> (a -> Bool) -> Tree a -> [Int] -> [Int]
- mapWithIndex :: (Int -> a -> b) -> Tree a -> Tree b
- mapWithIndex' :: (Int -> a -> b) -> Int -> Tree a -> Tree b
- traverseWithIndex :: Applicative f => (Int -> a -> f b) -> Tree a -> f (Tree b)
- traverseWithIndex' :: Applicative f => (Int -> a -> f b) -> Int -> Tree a -> f (Tree b)
- zip :: Tree a -> Tree b -> Tree (a, b)
- zipWith :: (a -> b -> c) -> Tree a -> Tree b -> Tree c
- zipWith' :: (a -> b -> c) -> TList a -> TList b -> TList c -> TList c
- ap :: Tree (a -> b) -> Tree a -> Tree b
Construction
Repetition
Sublists
tails :: MonadRandom m => Tree a -> m (Tree (Tree a)) Source #
O(n*log n). The sequence of suffixes of a sequence.
tailsWith :: MonadRandom m => (Tree a -> m b) -> Tree a -> m (Tree b) Source #
A generalization of tails
where the suffixes are passed to a
monadic continuation, recording their results.
tailsWith' :: Applicative m => (Tree a -> m b) -> Tree a -> m (Tree b) Source #
O(n*log n). The sequence of non-empty suffixes of a sequence.
The underlying tree structure is reused to represent the overall sequence, as well as every suffix, which might exacerbate worst case situations.
Sequential searches
Indexing
lookup :: Int -> Tree a -> Maybe a Source #
log(n). The element at the specified position, counting from 0.
Indexing with predicates
Transformations
traverseWithIndex :: Applicative f => (Int -> a -> f b) -> Tree a -> f (Tree b) Source #
traverseWithIndex' :: Applicative f => (Int -> a -> f b) -> Int -> Tree a -> f (Tree b) Source #