ghci-pretty: colored pretty-printing within ghci

[ development, library, mit ] [ Propose Tags ] [ Report a vulnerability ]

A tiny package that combines the ipprint package and the hscolour package to provide colored pretty-printing in ghci.

Usage

Add the following lines to your ghci.conf file:

-- Pretty printing of it
import IPPrint.Colored
:set -interactive-print=IPPrint.Colored.cpprint
:def cp (\_ -> return ":set -interactive-print=IPPrint.Colored.cpprint")
:def ncp (\_ -> return ":set -interactive-print=print")

Now you can enable colored pretty-printing in ghci with the commmand

:cp

The following command turns colored pretty-printing off again

:ncp

[Skip to Readme]

Modules

[Index]

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

Versions [RSS] 0.0.1, 0.0.2
Dependencies base (>=4 && <5), hscolour (>=1.20), ipprint (>=0.5) [details]
License MIT
Copyright Copyright (c) 2014 Lars Kuhtz <lakuhtz@gmail.com>
Author Lars Kuhtz
Maintainer Lars Kuhtz <lakuhtz@gmail.com>
Category Development
Home page https://github.com/larskuhtz/ghci-pretty
Source repo head: git clone https://github.com/larskuhtz/ghci-pretty
Uploaded by larsk at 2014-11-13T21:04:47Z
Distributions
Reverse Dependencies 2 direct, 0 indirect [details]
Downloads 2681 total (4 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2015-05-19 [all 1 reports]

Readme for ghci-pretty-0.0.2

[back to package description]

Build Status

A tiny package that combines the ipprint package and the hscolour package to provide colored pretty-printing in ghci.

Here is all the code from this package:

module IPPrint.Colored
( cpprint
) where

import IPPrint
import Language.Haskell.HsColour
import Language.Haskell.HsColour.Colourise
import Language.Haskell.HsColour.Output

cpprint :: Show a => a -> IO ()
cpprint = putStrLn . hscolour (TTYg XTerm256Compatible) defaultColourPrefs False False "" False . pshow

Usage

cabal update
cabal install ghci-pretty

Add the following lines to your ghci.conf file:

-- Pretty printing of it
import IPPrint.Colored
:set -interactive-print=IPPrint.Colored.cpprint
:def cp (\_ -> return ":set -interactive-print=IPPrint.Colored.cpprint")
:def ncp (\_ -> return ":set -interactive-print=print")

Now you can enable colored pretty-printing in ghci with the commmand

:cp

The following command turns colored pretty-printing off again

:ncp