Reconfigurable pretty-printing in GHCi
Phil Wadler wants to control the pretty-printer used to display output in GHCi. Something: adding a flag
-pretty <function-name>
The supplied function will typically have type (C a => a -> String) for some class C. Using Razvan's libary, he could declare
:set -pretty GenericPretty.pretty
for example.
Since this is GHCi-specific, one could use a new GHCi command instead:
:pretty GenericPretty.pretty
The latter design would presumably look up GenericPretty.pretty in the current context, and bleat if not found. The version with a flag might do that each time the pretty printer was used, which is arguably less efficient and (more important) more confusing. Personally I think I prefer the :pretty command best. (I'm not fussy about the name.)
Trac metadata
| Trac field | Value |
|---|---|
| Version | 7.2.1 |
| Type | Bug |
| TypeOfFailure | OtherFailure |
| Priority | normal |
| Resolution | Unresolved |
| Component | Compiler |
| Test case | |
| Differential revisions | |
| BlockedBy | |
| Related | |
| Blocking | |
| CC | wadler@inf.ed.ac.uk |
| Operating system | |
| Architecture |