tree-traversals-0.1.2.0: Functions and newtype wrappers for traversing Trees
Safe HaskellSafe-Inferred
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

Instances details
Functor BinaryTree Source # 
Instance details

Defined in Data.BinaryTree

Methods

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

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

TreeLike BinaryTree Source # 
Instance details

Defined in Data.Traversable.TreeLike

Methods

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

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

Defined in Data.BinaryTree

Eq a => Eq (BinaryTree a) Source # 
Instance details

Defined in Data.BinaryTree

Methods

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

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