Skip to content
Pretty print the standard output of default `Show` instances.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
src/Text
.gitignore
.travis.yml
LICENSE
README.md
Setup.hs
nicify-lib.cabal

README.md

nicify-lib

Build Status

nicify is a tool for pretty printing the default formatting of Show instances. It is especially useful when dumping data during debugging.

Example

Given main.hs:

data X = A [X] | B String | C (X, X)
  deriving (Show)

main = print $
  A [B "one", B "two", A [ C (B "three", B "three prime"), B "woop woop" ]]

you would typically get:

>>> runhaskell main.hs 
A [B "one",B "two",A [C (B "three",B "three prime"),B "woop woop"]]

not so with nicify:

import Text.Nicify

data Z = A [Z] | B String | C (Z, Z)
  deriving (Show)

main = putStrLn . nicify . show
  $ A [B "one", B "two", A [ C (B "three", B "three prime"), B "woop woop" ]]

results in:

>>> runhaskell main.hs -package nicify-lib
A [
    B "one",
    B "two",
    A [
        C (B "three",
        B "three prime"),
        B "woop woop"
    ]
]

nicify is also available as command line tool, see github.com/scravy/nicify

You can’t perform that action at this time.