pptable: Pretty Print containers in a tabular format

[ library, mit, text ] [ Propose Tags ]

Please see README.md


[Skip to Readme]

Modules

[Last Documentation]

  • Text
    • PrettyPrint
      • Text.PrettyPrint.PrettyTable
      • Text.PrettyPrint.Tabilize

Downloads

Note: This package has metadata revisions in the cabal description newer than included in the tarball. To unpack the package including the revisions, use 'cabal get'.

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

Versions [RSS] 0.1.0.0, 0.1.0.1, 0.2.0.0, 0.3.0.0
Dependencies base (>=4.7 && <4.9), boxes, containers, generic-deriving, pretty, syb, vector [details]
License MIT
Copyright 2016 Guru Devanla
Author Guru Devanla
Maintainer grdvnl@gmail.com
Revised Revision 1 made by GeorgeWilson at 2018-03-18T23:05:48Z
Category Text
Home page https://github.com/gdevanla/pptable#readme
Source repo head: git clone https://github.com/githubuser/pptable
Uploaded by gdevanla at 2016-09-30T12:55:45Z
Distributions LTSHaskell:0.3.0.0, NixOS:0.3.0.0, Stackage:0.3.0.0
Reverse Dependencies 2 direct, 0 indirect [details]
Downloads 3234 total (17 in the last 30 days)
Rating 2.0 (votes: 1) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs not available [build log]
All reported builds failed as of 2016-11-19 [all 3 reports]

Readme for pptable-0.1.0.0

[back to package description]

README

PrettyTable : Print any list, vector or map as a well-formatted readable table.

Text.PrettyPrint.PrettyTable

  • This module provides simple functions used to print values in tabular format
  • Version 0.1.0
  • Contributes and Bug Reports Welcome

Examples

 -- Printing a list of records
 :set -XDeriveGeneric
 :set -XDeriveDataTypeable

 import qualified GHC.Generics as G
 import Data.Data

 -- A record structure that will in a list
 data Stock = Stock {ticker::String, price::Double, marketCap::Double} deriving (Data, G.Generic)

 -- Create an instance of Tabilize
 instance Tabilize Stock

 let yahoo =  Stock {ticker="YHOO", price=42.29101010, marketCap=40e9}
 let google = Stock {ticker="GOOG", price=774.210101, marketCap=532.09e9}
 let amazon = Stock {ticker="AMZN", price=799.161717, marketCap=378.86e9}

 -- List of records
 let tickers = [yahoo, google, amazon]

 printList tickers

 ticker     price          marketCap
 "YHOO"     42.2910101         4.0e10
 "GOOG"     774.210101      5.3209e11
 "AMZN"     799.161717      3.7886e11