| Safe Haskell | Safe |
|---|---|
| Language | Haskell2010 |
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.
- hable :: Config style -> [[String]] -> String
- defaultConfig :: Config UnicodeStyle
Documentation
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.