Safe Haskell | Safe |
---|---|
Language | Haskell2010 |
A simple binary tree type, BinaryTree
.
Synopsis
- data BinaryTree a
- = Leaf
- | Branch (BinaryTree a) a (BinaryTree a)
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.
Leaf | |
Branch (BinaryTree a) a (BinaryTree a) |
Instances
Functor BinaryTree Source # | |
Defined in Data.BinaryTree fmap :: (a -> b) -> BinaryTree a -> BinaryTree b # (<$) :: a -> BinaryTree b -> BinaryTree a # | |
TreeLike BinaryTree Source # | |
Defined in Data.Traversable.TreeLike 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 # | |
Defined in Data.BinaryTree (==) :: BinaryTree a -> BinaryTree a -> Bool # (/=) :: BinaryTree a -> BinaryTree a -> Bool # | |
Show a => Show (BinaryTree a) Source # | |
Defined in Data.BinaryTree showsPrec :: Int -> BinaryTree a -> ShowS # show :: BinaryTree a -> String # showList :: [BinaryTree a] -> ShowS # |