symantic-grammar-0.2.0.20170709: Library for symantic grammars.
Language.Symantic.Grammar.BinTree
Contents
BinTree
Description
Binary tree, useful to build Abstract Syntax Tree (AST) made of applications of tokens.
Synopsis
data BinTree a Source #
Binary Tree.
Constructors
Instances
Methods
(>>=) :: BinTree a -> (a -> BinTree b) -> BinTree b #
(>>) :: BinTree a -> BinTree b -> BinTree b #
return :: a -> BinTree a #
fail :: String -> BinTree a #
fmap :: (a -> b) -> BinTree a -> BinTree b #
(<$) :: a -> BinTree b -> BinTree a #
pure :: a -> BinTree a #
(<*>) :: BinTree (a -> b) -> BinTree a -> BinTree b #
(*>) :: BinTree a -> BinTree b -> BinTree b #
(<*) :: BinTree a -> BinTree b -> BinTree a #
fold :: Monoid m => BinTree m -> m #
foldMap :: Monoid m => (a -> m) -> BinTree a -> m #
foldr :: (a -> b -> b) -> b -> BinTree a -> b #
foldr' :: (a -> b -> b) -> b -> BinTree a -> b #
foldl :: (b -> a -> b) -> b -> BinTree a -> b #
foldl' :: (b -> a -> b) -> b -> BinTree a -> b #
foldr1 :: (a -> a -> a) -> BinTree a -> a #
foldl1 :: (a -> a -> a) -> BinTree a -> a #
toList :: BinTree a -> [a] #
null :: BinTree a -> Bool #
length :: BinTree a -> Int #
elem :: Eq a => a -> BinTree a -> Bool #
maximum :: Ord a => BinTree a -> a #
minimum :: Ord a => BinTree a -> a #
sum :: Num a => BinTree a -> a #
product :: Num a => BinTree a -> a #
traverse :: Applicative f => (a -> f b) -> BinTree a -> f (BinTree b) #
sequenceA :: Applicative f => BinTree (f a) -> f (BinTree a) #
mapM :: Monad m => (a -> m b) -> BinTree a -> m (BinTree b) #
sequence :: Monad m => BinTree (m a) -> m (BinTree a) #
(==) :: BinTree a -> BinTree a -> Bool #
(/=) :: BinTree a -> BinTree a -> Bool #
showsPrec :: Int -> BinTree a -> ShowS #
show :: BinTree a -> String #
showList :: [BinTree a] -> ShowS #
(<>) :: BinTree a -> BinTree a -> BinTree a #
sconcat :: NonEmpty (BinTree a) -> BinTree a #
stimes :: Integral b => b -> BinTree a -> BinTree a #
collapseBT :: (a -> a -> a) -> BinTree a -> a Source #
Collapse depth-first given BinTree with given function.
Useful to apply all arguments.