seqn-0.1.1.0: Sequences and measured sequences
Safe HaskellSafe-Inferred
LanguageHaskell2010

Data.Seqn.Internal.Tree

Description

This is an internal module. You probably don't need to import this. Use Data.Seqn.Seq instead.

WARNING

Definitions in this module allow violating invariants that would otherwise be guaranteed by Data.Seqn.Seq. Use at your own risk!

Synopsis

Tree

data Tree a Source #

Constructors

Bin !Int !a !(Tree a) !(Tree a) 
Tip 

Instances

Instances details
NFData1 Tree Source # 
Instance details

Defined in Data.Seqn.Internal.Tree

Methods

liftRnf :: (a -> ()) -> Tree a -> () #

NFData a => NFData (Tree a) Source # 
Instance details

Defined in Data.Seqn.Internal.Tree

Methods

rnf :: Tree a -> () #

Basic

size :: Tree a -> Int Source #

bin :: a -> Tree a -> Tree a -> Tree a Source #

Folds

foldl' :: (b -> a -> b) -> b -> Tree a -> b Source #

ifoldl' :: (Int -> b -> a -> b) -> b -> Int -> Tree a -> b Source #

foldr' :: (a -> b -> b) -> b -> Tree a -> b Source #

ifoldr' :: (Int -> a -> b -> b) -> b -> Int -> Tree a -> b Source #

traverse :: Applicative f => (a -> f b) -> Tree a -> f (Tree b) Source #

itraverse :: Applicative f => (Int -> a -> f b) -> Int -> Tree a -> f (Tree b) Source #

Construct

generateA :: Applicative f => (Int -> f a) -> Int -> Int -> f (Tree a) Source #

Index

adjustF :: Functor f => (a -> f a) -> Int -> Tree a -> f (Tree a) Source #

insertAt :: Int -> a -> Tree a -> Tree a Source #

deleteAt :: Int -> Tree a -> Tree a Source #

Slice

cons :: a -> Tree a -> Tree a Source #

snoc :: Tree a -> a -> Tree a Source #

uncons :: Tree a -> SMaybe (S2 a (Tree a)) Source #

unsnoc :: Tree a -> SMaybe (S2 (Tree a) a) Source #

splitAtF :: Biapplicative f => Int -> Tree a -> f (Tree a) (S2 a (Tree a)) Source #

Transform

mapMaybeA :: Applicative f => (a -> f (Maybe b)) -> Tree a -> f (Tree b) Source #

mapEitherA :: Applicative f => (a -> f (Either b c)) -> Tree a -> f (S2 (Tree b) (Tree c)) Source #

Zip and unzip

zipWithStreamM :: Monad m => (a -> b -> m c) -> Tree a -> Stream b -> m (Tree c) Source #

unzipWithA :: Applicative f => (a -> f (b, c)) -> Tree a -> f (S2 (Tree b) (Tree c)) Source #

unzipWith3A :: Applicative f => (a -> f (b, c, d)) -> Tree a -> f (S3 (Tree b) (Tree c) (Tree d)) Source #

Tree helpers

fold :: b -> (Int -> a -> b -> b -> b) -> (Int -> a -> b -> b) -> (Int -> a -> b -> b) -> (a -> b) -> Tree a -> b Source #

foldSimple :: b -> (Int -> a -> b -> b -> b) -> Tree a -> b Source #

link :: a -> Tree a -> Tree a -> Tree a Source #

glue :: Tree a -> Tree a -> Tree a Source #

merge :: Tree a -> Tree a -> Tree a Source #

balanceL :: a -> Tree a -> Tree a -> Tree a Source #

balanceR :: a -> Tree a -> Tree a -> Tree a Source #

Testing