tree-traversals-0.1.0.0: Functions and newtype wrappers for traversing Trees

Safe HaskellSafe
LanguageHaskell2010

Data.BinaryTree

Description

A simple binary tree type, BinaryTree.

Synopsis

Documentation

data BinaryTree a Source #

A binary tree

Since there are multiple ways to traverse a BinaryTree, see Data.Traversable.TreeLike for newtype-wrappers with Traversable instances.

Constructors

Leaf 
Branch (BinaryTree a) a (BinaryTree a) 

Instances

Functor BinaryTree Source # 

Methods

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

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

TreeLike BinaryTree Source # 

Methods

treeTraverse :: Applicative f => (a -> f b) -> (forall (subtree :: * -> *). TreeLike subtree => subtree a -> f (subtree b)) -> BinaryTree a -> f (BinaryTree b) Source #

Eq a => Eq (BinaryTree a) Source # 

Methods

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

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

Show a => Show (BinaryTree a) Source #