hgeometry-combinatorial-0.9.0.0: Data structures, and Data types.

Data.BinaryTree.Zipper

Synopsis

# Documentation

data Ctx a Source #

Constructors

 Top L (Ctx a) a (BinaryTree a) R (BinaryTree a) a (Ctx a)
Instances
 Source # Instance detailsDefined in Data.BinaryTree.Zipper Methodsfmap :: (a -> b) -> Ctx a -> Ctx b #(<$) :: a -> Ctx b -> Ctx a # Source # Instance detailsDefined in Data.BinaryTree.Zipper Methodsfold :: Monoid m => Ctx m -> m #foldMap :: Monoid m => (a -> m) -> Ctx a -> m #foldr :: (a -> b -> b) -> b -> Ctx a -> b #foldr' :: (a -> b -> b) -> b -> Ctx a -> b #foldl :: (b -> a -> b) -> b -> Ctx a -> b #foldl' :: (b -> a -> b) -> b -> Ctx a -> b #foldr1 :: (a -> a -> a) -> Ctx a -> a #foldl1 :: (a -> a -> a) -> Ctx a -> a #toList :: Ctx a -> [a] #null :: Ctx a -> Bool #length :: Ctx a -> Int #elem :: Eq a => a -> Ctx a -> Bool #maximum :: Ord a => Ctx a -> a #minimum :: Ord a => Ctx a -> a #sum :: Num a => Ctx a -> a #product :: Num a => Ctx a -> a # Source # Instance detailsDefined in Data.BinaryTree.Zipper Methodstraverse :: Applicative f => (a -> f b) -> Ctx a -> f (Ctx b) #sequenceA :: Applicative f => Ctx (f a) -> f (Ctx a) #mapM :: Monad m => (a -> m b) -> Ctx a -> m (Ctx b) #sequence :: Monad m => Ctx (m a) -> m (Ctx a) # Eq a => Eq (Ctx a) Source # Instance detailsDefined in Data.BinaryTree.Zipper Methods(==) :: Ctx a -> Ctx a -> Bool #(/=) :: Ctx a -> Ctx a -> Bool # Ord a => Ord (Ctx a) Source # Instance detailsDefined in Data.BinaryTree.Zipper Methodscompare :: Ctx a -> Ctx a -> Ordering #(<) :: Ctx a -> Ctx a -> Bool #(<=) :: Ctx a -> Ctx a -> Bool #(>) :: Ctx a -> Ctx a -> Bool #(>=) :: Ctx a -> Ctx a -> Bool #max :: Ctx a -> Ctx a -> Ctx a #min :: Ctx a -> Ctx a -> Ctx a # Read a => Read (Ctx a) Source # Instance detailsDefined in Data.BinaryTree.Zipper MethodsreadsPrec :: Int -> ReadS (Ctx a) #readList :: ReadS [Ctx a] #readPrec :: ReadPrec (Ctx a) # Show a => Show (Ctx a) Source # Instance detailsDefined in Data.BinaryTree.Zipper MethodsshowsPrec :: Int -> Ctx a -> ShowS #show :: Ctx a -> String #showList :: [Ctx a] -> ShowS # Constructors  Loc (BinaryTree a) (Ctx a) Instances  Source # Instance detailsDefined in Data.BinaryTree.Zipper Methodsfmap :: (a -> b) -> BinaryTreeZipper a -> BinaryTreeZipper b #(<$) :: a -> BinaryTreeZipper b -> BinaryTreeZipper a # Source # Instance detailsDefined in Data.BinaryTree.Zipper Methodsfold :: Monoid m => BinaryTreeZipper m -> m #foldMap :: Monoid m => (a -> m) -> BinaryTreeZipper a -> m #foldr :: (a -> b -> b) -> b -> BinaryTreeZipper a -> b #foldr' :: (a -> b -> b) -> b -> BinaryTreeZipper a -> b #foldl :: (b -> a -> b) -> b -> BinaryTreeZipper a -> b #foldl' :: (b -> a -> b) -> b -> BinaryTreeZipper a -> b #foldr1 :: (a -> a -> a) -> BinaryTreeZipper a -> a #foldl1 :: (a -> a -> a) -> BinaryTreeZipper a -> a #toList :: BinaryTreeZipper a -> [a] #elem :: Eq a => a -> BinaryTreeZipper a -> Bool #maximum :: Ord a => BinaryTreeZipper a -> a #minimum :: Ord a => BinaryTreeZipper a -> a #sum :: Num a => BinaryTreeZipper a -> a #product :: Num a => BinaryTreeZipper a -> a # Source # Instance detailsDefined in Data.BinaryTree.Zipper Methodstraverse :: Applicative f => (a -> f b) -> BinaryTreeZipper a -> f (BinaryTreeZipper b) #sequenceA :: Applicative f => BinaryTreeZipper (f a) -> f (BinaryTreeZipper a) #mapM :: Monad m => (a -> m b) -> BinaryTreeZipper a -> m (BinaryTreeZipper b) #sequence :: Monad m => BinaryTreeZipper (m a) -> m (BinaryTreeZipper a) # Eq a => Eq (BinaryTreeZipper a) Source # Instance detailsDefined in Data.BinaryTree.Zipper Methods Ord a => Ord (BinaryTreeZipper a) Source # Instance detailsDefined in Data.BinaryTree.Zipper Methods(<) :: BinaryTreeZipper a -> BinaryTreeZipper a -> Bool #(>) :: BinaryTreeZipper a -> BinaryTreeZipper a -> Bool # Read a => Read (BinaryTreeZipper a) Source # Instance detailsDefined in Data.BinaryTree.Zipper Methods Show a => Show (BinaryTreeZipper a) Source # Instance detailsDefined in Data.BinaryTree.Zipper MethodsshowList :: [BinaryTreeZipper a] -> ShowS #

Focus on the root

Go to the left child

Go to the right child

Move to the parent

Navigate to the root

Returns a list of zippers; one focussed on each node in the tree

Get the value stored at the current node

subTrees :: BinaryTree a -> [BinaryTree a] Source #

Returns all subtrees; i.e. every node with all its decendents

Splits the tree here, returns a pair (innerTree,outerTree)