apart-0.1.1: Get all your structure and rip it apart.
Data.Apart.Structures.Tree.Binary
Synopsis
type Binary = Cofree Branches Source #
data Branches a Source #
Constructors
No children
Left child
Right child
Both
Instances
Methods
fmap :: (a -> b) -> Branches a -> Branches b #
(<$) :: a -> Branches b -> Branches a #
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 #
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) #
(<.>) :: 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
(>>-) :: Branches a -> (a -> Branches b) -> Branches b
join :: Branches (Branches a) -> Branches a
(<!>) :: Branches a -> Branches a -> Branches a
some :: Applicative Branches => Branches a -> Branches [a]
many :: Applicative Branches => Branches a -> Branches [a]
showsPrec :: Int -> Branches a -> ShowS #
show :: Branches a -> String #
showList :: [Branches a] -> ShowS #
(<>) :: 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.
x
Branches x y
Less x
gt :: Binary a -> Segment Binary a Source #
Get y from Branches x y or from Greater y.
y
Greater y
singleton :: a -> Binary a Source #
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.