PathTree-0.1.0.0: A tree used to merge and fold paths

Copyright(c) Pedro Rodriguez Tavarez <pedro@pjrt.co>
LicenseBSD3-style (see LICENSE)
MaintainerPedro Rodriguez Tavarez <pedro@pjrt.co>
Stabilityunstable
Portabilityunportable
Safe HaskellSafe
LanguageHaskell2010

Data.LCRSTree

Description

 

Synopsis

Documentation

data LCRSTree n Source #

Constructors

Empty 
Leaf n (LCRSTree n) 
Node n (LCRSTree n) (LCRSTree n) 

Instances

Functor LCRSTree Source #

Functor instance

Methods

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

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

Foldable LCRSTree Source # 

Methods

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

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

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

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

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

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

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

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

toList :: LCRSTree a -> [a] #

null :: LCRSTree a -> Bool #

length :: LCRSTree a -> Int #

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

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

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

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

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

Eq n => Eq (LCRSTree n) Source # 

Methods

(==) :: LCRSTree n -> LCRSTree n -> Bool #

(/=) :: LCRSTree n -> LCRSTree n -> Bool #

Show n => Show (LCRSTree n) Source # 

Methods

showsPrec :: Int -> LCRSTree n -> ShowS #

show :: LCRSTree n -> String #

showList :: [LCRSTree n] -> ShowS #

lcrsDepth :: Integral i => LCRSTree n -> i Source #

Return the depth of the tree. This means the depth of the longest branch

fromRoseTree :: Tree n -> LCRSTree n Source #

Convert a Tree into a LCRSTree

toRoseTree :: LCRSTree n -> Tree n Source #

Convert a LCRSTree into a Tree

This function fails if a non-top Node is passed. A non-top node is a node Node n c s where s /= Empty.