Ticket #5461 (closed feature request: fixed)
Reconfigurable pretty-printing in GHCi
| Reported by: | simonpj | Owned by: | bravit |
|---|---|---|---|
| Priority: | normal | Milestone: | 7.6.1 |
| Component: | Compiler | Version: | 7.2.1 |
| Keywords: | Cc: | wadler@…, bravit111@…, dterei | |
| Operating System: | Unknown/Multiple | Architecture: | Unknown/Multiple |
| Type of failure: | None/Unknown | Difficulty: | Unknown |
| Test Case: | Blocked By: | ||
| Blocking: | Related Tickets: |
Description
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.)

