tree-traversals-0.1.1.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 # 
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 #

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

Defined in Data.BinaryTree

Methods

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

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

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

Defined in Data.BinaryTree