apart-0.1.1: Get all your structure and rip it apart.

Safe HaskellSafe
LanguageHaskell2010

Data.Apart.Structures.Tree.Binary

Synopsis

Documentation

type Binary = Cofree Branches Source #

data Branches a Source #

Constructors

End

No children

Less a

Left child

Greater a

Right child

Branches a a

Both

Instances

Functor Branches Source # 

Methods

fmap :: (a -> b) -> Branches a -> Branches b #

(<$) :: a -> Branches b -> Branches a #

Foldable Branches Source # 

Methods

fold :: Monoid m => Branches m -> m #

foldMap :: Monoid m => (a -> m) -> Branches a -> m #

foldr :: (a -> b -> b) -> b -> Branches a -> b #

foldr' :: (a -> b -> b) -> b -> Branches a -> b #

foldl :: (b -> a -> b) -> b -> Branches a -> b #

foldl' :: (b -> a -> b) -> b -> Branches a -> b #

foldr1 :: (a -> a -> a) -> Branches a -> a #

foldl1 :: (a -> a -> a) -> Branches a -> a #

toList :: Branches a -> [a] #

null :: Branches a -> Bool #

length :: Branches a -> Int #

elem :: Eq a => a -> Branches a -> Bool #

maximum :: Ord a => Branches a -> a #

minimum :: Ord a => Branches a -> a #

sum :: Num a => Branches a -> a #

product :: Num a => Branches a -> a #

Traversable Branches Source # 

Methods

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

sequenceA :: Applicative f => Branches (f a) -> f (Branches a) #

mapM :: Monad m => (a -> m b) -> Branches a -> m (Branches b) #

sequence :: Monad m => Branches (m a) -> m (Branches a) #

Apply Branches Source # 

Methods

(<.>) :: Branches (a -> b) -> Branches a -> Branches b

(.>) :: Branches a -> Branches b -> Branches b

(<.) :: Branches a -> Branches b -> Branches a

liftF2 :: (a -> b -> c) -> Branches a -> Branches b -> Branches c

Bind Branches Source # 

Methods

(>>-) :: Branches a -> (a -> Branches b) -> Branches b

join :: Branches (Branches a) -> Branches a

Alt Branches Source # 
Show a => Show (Branches a) Source # 

Methods

showsPrec :: Int -> Branches a -> ShowS #

show :: Branches a -> String #

showList :: [Branches a] -> ShowS #

Semigroup (Branches a) Source # 

Methods

(<>) :: Branches a -> Branches a -> Branches a #

sconcat :: NonEmpty (Branches a) -> Branches a #

stimes :: Integral b => b -> Branches a -> Branches a #

ls :: Binary a -> Segment Binary a Source #

Get x from Branches x y or from Less x.

gt :: Binary a -> Segment Binary a Source #

Get y from Branches x y or from Greater y.

insert :: Ord a => Binary a -> a -> Binary a Source #

height :: Binary a -> Int Source #

The way to the most remote branch.

factor :: Binary a -> Int Source #

Balance factor for root node.