Karya, built on Mon Jul 24 11:39:07 PDT 2017 (patch 33511aca01257b76b88de7c7a2763b7a965c084e)

Safe HaskellNone

Util.PPrint

Contents

Description

This is based on gleb.alexeev@gmail.com's ipprint package on hackage.

I'm not just using it directly because I want to pass custom formatting flags because my terminal is 80 chars wide, not the 137-whatever default.

Synopsis

Documentation

pprint :: Show a => a -> IO () Source #

pshow :: Show a => a -> String Source #

Pretty show.

format :: String -> String Source #

Pretty up a string containing a parseable haskell value.

format_str :: String -> String Source #

Pretty up haskell value, unless it's a string, in which case return it directly.

Previously I needed this in the REPL since it didn't have a way to say text should be unformatted. I don't need it any more, but it doesn't seem to be hurting so I'll leave it here for now.

util

record :: [(String, String)] -> String Source #

pprint does ok for records, but it doesn't work so well if I want to print part of the record, or change the types. A real record system for haskell would probably fix this.