tracetree-0.1.0.0: Visualize Haskell data structures as edge-labeled trees

Safe HaskellSafe
LanguageHaskell2010

Debug.Trace.Tree.Rose

Contents

Description

Additional operations on standard rose trees

Synopsis

Annotating nodes

type Depth = Int Source

Depth of a node in the tree

type Offset = Int Source

Offset of a node in the tree

This is the horizontal offset of a node across all nodes at that depth.

For example, the offsets of

    A
   / \
  B   C
 / \   \
D   E   F

are given by

      (A,0)
       / \
   (B,0)  (C,1)
    / \      \
(D,0)  (E,1)  (F,2)

Similarly, the offsets of

  A
 / \
B   C
   / \
  D   E

are given by

   (A,0)
    / \
(B,0) (C,1)
      /   \
  (D,0)   (E,1)

Note that in this second example, D gets number 0 because it's the first node at this level; it's therefore not the case that the nodes with number 0 necessarily make up the _spine_ of the tree.

data Coords Source

Coordinates of a node in the tree

Constructors

Coords 

Fields

depth :: Depth

The "y coordinate" (depth in the tree)

offset :: Offset

The "x coordinate" (across all nodes at this depth)

data Metadata Source

Metadata of a node in the tree

Constructors

Metadata