-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/


-- | Library for functions pertaining to tree exploration and manipulation
--   
--   Library for functions pertaining to tree exploration and manipulation
@package tree-fun
@version 0.8.1.0


-- | Collects all types used in the program
module Math.TreeFun.Types
data PropertySuperTree a b
PropertySuperTree :: !Tree (SuperNode a) -> !PropertyMap a b -> PropertySuperTree a b
[superTree] :: PropertySuperTree a b -> !Tree (SuperNode a)
[superProperties] :: PropertySuperTree a b -> !PropertyMap a b
data SuperNode a
SuperRoot :: SuperNode a
SuperNode :: !a -> !SuperNode a -> !Map a (Int, Int) -> SuperNode a
[myRootLabel] :: SuperNode a -> !a
[myParent] :: SuperNode a -> !SuperNode a
[myLeaves] :: SuperNode a -> !Map a (Int, Int)
type Height = Int
type DistanceMap a = Map a (Map Int (Seq a))
type PropertyMap a b = Map a (Seq b)
type MaybePropertyMap a b = Map a (Maybe (Seq b))
instance GHC.Classes.Ord a => GHC.Classes.Ord (Math.TreeFun.Types.SuperNode a)
instance GHC.Classes.Eq a => GHC.Classes.Eq (Math.TreeFun.Types.SuperNode a)
instance GHC.Show.Show a => GHC.Show.Show (Math.TreeFun.Types.SuperNode a)
instance (GHC.Read.Read a, GHC.Classes.Ord a) => GHC.Read.Read (Math.TreeFun.Types.SuperNode a)


-- | Collects all functions pertaining to trees
module Math.TreeFun.Tree

-- | Convert a bool to an integer
boolToInt :: Bool -> Int

-- | Find out if a node is a leaf or not
isLeaf :: Tree a -> Bool

-- | Return the labels of the leaves of the tree
leaves :: Tree a -> [a]

-- | Return the labels of the leaves of the tree with their relative
--   heights from the root (the input number you give determines how many
--   steps away the leaves are, should almost always start at 0)
leavesHeight :: Ord a => Int -> Tree a -> Map a Int

-- | Return the labels of the leaves of the tree with their relative
--   heights from the root (the input number you give determines how many
--   steps away the leaves are, should almost always start at 0). Also,
--   here we give leaves that share a parent a separate label.
leavesCommonHeight :: Ord a => Int -> Tree a -> Map a (Int, Int)

-- | Return the labels of the leaves of the tree with their weights
--   determined by the product of the number of children of their parents
--   all the way up to the root, along with their distance. Returns Double
--   for more precision.
leavesParentMult :: Ord a => Double -> Double -> Tree a -> Map a (Double, Double)

-- | Return the labels of the leaves of the tree with their weights
--   determined by the product of the number of children of their parents
--   all the way up to the root. Also, here we give leaves that share a
--   parent a separate label.
leavesCommonParentMult :: Ord a => Int -> Tree a -> Map a (Int, Int)

-- | Return the labels of the leaves of the tree with their relative
--   heights from the root (the input number you give determines how many
--   steps away the leaves are, should almost always start at 0), slower
--   version not requiring Ord but no Maps
leavesHeightList :: Int -> Tree a -> [(a, Int)]

-- | Return the inner nodes of the tree
innerNodes :: Tree a -> [a]

-- | Return the number of leaves in a tree
numLeaves :: Num b => Tree a -> b

-- | Return the number of inner nodes of a tree
numInner :: Num b => Tree a -> b

-- | Return True if a tree has a leaf connected to the root of the given
--   tree
hasRootLeaf :: Tree a -> Bool

-- | Return the list of root leaves
getRootLeaves :: Tree a -> [a]

-- | Return the list of properties in a property map for a tree
getProperties :: Eq b => PropertyMap a b -> [b]

-- | Remove leaves from a tree
filterLeaves :: Tree a -> Tree a

-- | Remove leaves attached to the root of the tree
filterRootLeaves :: Tree a -> Tree a

-- | Return the map of distances from each leaf to another leaf
getDistanceMap :: (Eq a, Ord a) => Tree a -> DistanceMap a

-- | Find the distance between two leaves in a tree.
getDistance :: Eq a => Tree a -> a -> a -> Int

-- | Return the map of distances from each leaf to another leaf
getDistanceMapSuperNode :: (Eq a, Ord a) => Tree (SuperNode a) -> DistanceMap a

-- | Find the distance between two leaves in a leafNode tree. Begin
--   recording distances when record is True (should have height starting
--   at 0)
getDistanceSuperNode :: (Eq a, Ord a) => Tree (SuperNode a) -> a -> a -> Int

-- | Get the sum of a tree for a tree with numbered labels
sumTree :: Num a => Tree a -> a

-- | Convert a tree to the LeafNode tree data structure (the leaves are in
--   the nodes)
toSuperNodeTree :: Ord a => SuperNode a -> Tree a -> Tree (SuperNode a)
