Hi all,

The derived Show instance is useful, but I sometimes wish for
something that's easier to read for big data types. Does anyone have
an implementation of show that draws things in a hierarchical manner?
Example:

Given

    data Tree a = Leaf | Bin Int a (Tree a) (Tree a)

and

    value = Bin 1 (Bin 2 Leaf Leaf) (Bin 3 Leaf Leaf)

draw as

Bin
  1
  Bin
    2
    Leaf
    Leaf
  Bin
    3
    Leaf
    Leaf

Cheers,
Johan

_______________________________________________
Haskell-Cafe mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/haskell-cafe

Reply via email to