hable-0.3.0: customizable pretty printer library for tables

Safe HaskellSafe
LanguageHaskell2010

Hable

Description

Pretty-print a table in a configurable way.

Using the default configuration, this program:

import Hable

main :: IO ()
main = putStr (hable defaultConfig exampleTable)

exampleTable =
    [ [ "one", "two", "three", Hable ]
    , [ "hellonworld", "loremnipsumndolornsit amet", "verryyyyyy llooong", "is"]
    , [ "super", "awesome", "freaking", "amazing" ]
    ]

will result in:

╔═══════╤══════════╤════════════════════╤═════════╗
║ one   │ two      │ three              │ Hable   ║
╟───────┼──────────┼────────────────────┼─────────╢
║ hello │ lorem    │ verryyyyyy llooong │ is      ║
║ world │ ipsum    │                    │         ║
║       │ dolor    │                    │         ║
║       │ sit amet │                    │         ║
╟───────┼──────────┼────────────────────┼─────────╢
║ super │ awesome  │ freaking           │ amazing ║
╚═══════╧══════════╧════════════════════╧═════════╝

See Config for configuration.

Synopsis

Documentation

hable Source #

Arguments

:: Config style

Hable Configuration

-> [[String]]

Row-wise table to be pretty-printed

-> String

Pretty-printed table

Pretty-prints a row-wise given table using a given Hable Configuration.

defaultConfig :: Config UnicodeStyle Source #

The default configuration uses Unicode box characters.