Tree representation and pretty-printing of data structures based on SYB
Haskell
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
src cleanup Apr 12, 2013
LICENSE Correct mode of LICENSE Aug 15, 2013
README.md Readme Mar 25, 2013
repr-tree-syb.cabal Update the package version Sep 22, 2016

README.md

ReprTree

A simple library which provides a convenient way to inspect and debug arbitrary data structures.

Following is an example of an output this library produces.

:
- A
| - :
| | - a
| | - b
| | - c
| - 9
- C
| - 3
- B
- D
  - :
    - :
    | - asdf
    | - 123
    | - ldskfjkl
    - :
      - f

Which is a result of running the following code:

import Data.Generics (Data, Typeable)

data SomeType = 
  A [String] Int | 
  B | 
  C Int | 
  D [[String]]
  deriving (Typeable, Data)

xxx = A ["a", "b", "c"] 9 
    : C 3 
    : B 
    : D [["asdf", "123", "ldskfjkl"], ["f"]]
    : []

main = putStrLn $ reprTreeString xxx