radix-tree-1.0.0.0: Radix trees.
Safe HaskellSafe-Inferred
LanguageHaskell2010

Data.Zebra.Word.Debug

Contents

Description

Safe functions for datatype introspection.

Synopsis

Show

showsTree :: Zebra -> ShowS Source #

\(\mathcal{O}(n)\). Shows the internal structure of the tree.

Validate

data Validity Source #

Whether the tree is well-formed.

Constructors

Valid 
Invalid Reason 

Instances

Instances details
Show Validity Source # 
Instance details

Defined in Data.Zebra.Word.Debug

data Reason Source #

Reason for why the tree is considered malformed.

Constructors

ZeroPrefix

Prefix is 0.

PrefixBelow Prefix Prefix

Prefix below diverges from the prefix above

KeyBelow Prefix Key

Key diverges the prefix above

FoundNil

Nil is in the tree.

ZeroKey

Tip has a value of zero despite not being the root.

NoSwitch Color Key

Key has the same color as the key to the left of it.

Instances

Instances details
Show Reason Source # 
Instance details

Defined in Data.Zebra.Word.Debug

validate :: Zebra -> Validity Source #

\(\mathcal{O}(n)\). Checks whether the tree is well-formed.