-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Change Show-instances to use
"#field := val"
The previous show instance would add another layer of quoting for each nesting: ``` ghci> show (rcons (#foo := "bar") rnil) "[(\"foo\",\"\\\"bar\\\"\")]" ``` Instead, what we want is to display a nicely readable variant of the record, using the infix field syntax for both label/value pairs and full records: ``` ghci> show (rcons (#hi := (rcons (#lea := "hi") rnil)) (rcons (#foo := "bar") rnil )) "[#foo := \"bar\",#hi := [(#lea := \"hi\")]]" ghci> show (#hi := "lea") "#hi := \"lea\"" ``` That’s better! Note that we can’t have a roundtripping `Read` instance anyway, so we might as well have `Show` be readable. Fixes #36
- Loading branch information
1 parent
5a7d686
commit 23d3873
Showing
3 changed files
with
16 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters