hgeometry-0.8.0.0: Geometric Algorithms, Data structures, and Data types.

Safe HaskellNone
LanguageHaskell2010

Data.BinaryTree.Zipper

Synopsis

Documentation

data Ctx a Source #

Constructors

Top 
L (Ctx a) a (BinaryTree a) 
R (BinaryTree a) a (Ctx a) 
Instances
Functor Ctx Source # 
Instance details

Defined in Data.BinaryTree.Zipper

Methods

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

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

Foldable Ctx Source # 
Instance details

Defined in Data.BinaryTree.Zipper

Methods

fold :: 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 #

Traversable Ctx Source # 
Instance details

Defined in Data.BinaryTree.Zipper

Methods

traverse :: 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 details

Defined in Data.BinaryTree.Zipper

Methods

(==) :: Ctx a -> Ctx a -> Bool #

(/=) :: Ctx a -> Ctx a -> Bool #

Ord a => Ord (Ctx a) Source # 
Instance details

Defined in Data.BinaryTree.Zipper

Methods

compare :: 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 details

Defined in Data.BinaryTree.Zipper

Show a => Show (Ctx a) Source # 
Instance details

Defined in Data.BinaryTree.Zipper

Methods

showsPrec :: Int -> Ctx a -> ShowS #

show :: Ctx a -> String #

showList :: [Ctx a] -> ShowS #

data BinaryTreeZipper a Source #

Constructors

Loc (BinaryTree a) (Ctx a) 
Instances
Functor BinaryTreeZipper Source # 
Instance details

Defined in Data.BinaryTree.Zipper

Methods

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

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

Foldable BinaryTreeZipper Source # 
Instance details

Defined in Data.BinaryTree.Zipper

Methods

fold :: 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] #

null :: BinaryTreeZipper a -> Bool #

length :: BinaryTreeZipper a -> Int #

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 #

Traversable BinaryTreeZipper Source # 
Instance details

Defined in Data.BinaryTree.Zipper

Methods

traverse :: 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 details

Defined in Data.BinaryTree.Zipper

Ord a => Ord (BinaryTreeZipper a) Source # 
Instance details

Defined in Data.BinaryTree.Zipper

Read a => Read (BinaryTreeZipper a) Source # 
Instance details

Defined in Data.BinaryTree.Zipper

Show a => Show (BinaryTreeZipper a) Source # 
Instance details

Defined in Data.BinaryTree.Zipper

top :: BinaryTree a -> BinaryTreeZipper a Source #

Focus on the root

left :: BinaryTreeZipper a -> Maybe (BinaryTreeZipper a) Source #

Go to the left child

right :: BinaryTreeZipper a -> Maybe (BinaryTreeZipper a) Source #

Go to the right child

up :: BinaryTreeZipper a -> Maybe (BinaryTreeZipper a) Source #

Move to the parent

toRoot :: BinaryTreeZipper a -> BinaryTreeZipper a Source #

Navigate to the root

visitAll :: BinaryTree a -> [BinaryTreeZipper a] Source #

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

accessZ :: BinaryTreeZipper a -> Maybe a Source #

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

splitTree :: BinaryTreeZipper a -> (BinaryTree a, BinaryTree a) Source #

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