summaryrefslogtreecommitdiff
path: root/libraries/base/tests/all.T
diff options
context:
space:
mode:
authorRyan Scott <ryan.gl.scott@gmail.com>2017-08-22 09:29:07 -0400
committerRyan Scott <ryan.gl.scott@gmail.com>2017-08-22 09:29:07 -0400
commit8fd959998e900dffdb7f752fcd42df7aaedeae6e (patch)
treecddc1e31d91e2a0b1aa6f4a020a6fddd7578f84b /libraries/base/tests/all.T
parent8476097609a2044e965157380aeb5d4882a71248 (diff)
downloadhaskell-8fd959998e900dffdb7f752fcd42df7aaedeae6e.tar.gz
Make the Read instance for Proxy (and friends) ignore precedence
Summary: The `Read` instance for `Proxy`, as well as a handful of other data types in `base` which only have a single constructor, are doing something skeevy: they're requiring that they be surrounded by parentheses if the parsing precedence is sufficiently high. This means that `"Thing (Proxy)"` would parse, but not `"Thing Proxy"`. But the latter really ought to parse, since there's no need to surround a single constructor with parentheses. Indeed, that's the output of `show (Thing Proxy)`, so the current `Read` instance for `Proxy` violates `read . show = id`. The simple solution is to change `readParen (d > 10)` to `readParen False` in the `Read` instance for `Proxy`. But given that a derived `Read` instance would essentially accomplish the same thing, but with even fewer characters, I've opted to just replace the hand-rolled `Read` instance with a derived one. Test Plan: make test TEST=T12874 Reviewers: ekmett, austin, hvr, goldfire, bgamari Reviewed By: bgamari Subscribers: rwbarton, thomie GHC Trac Issues: #12874 Differential Revision: https://phabricator.haskell.org/D3871
Diffstat (limited to 'libraries/base/tests/all.T')
-rw-r--r--libraries/base/tests/all.T1
1 files changed, 1 insertions, 0 deletions
diff --git a/libraries/base/tests/all.T b/libraries/base/tests/all.T
index d97d79afe3..970fb7e454 100644
--- a/libraries/base/tests/all.T
+++ b/libraries/base/tests/all.T
@@ -205,6 +205,7 @@ test('T12494', normal, compile_and_run, [''])
test('T12852', when(opsys('mingw32'), skip), compile_and_run, [''])
test('lazySTexamples', normal, compile_and_run, [''])
test('T11760', normal, compile_and_run, ['-threaded -with-rtsopts=-N2'])
+test('T12874', normal, compile_and_run, [''])
test('T13191',
[ stats_num_field('bytes allocated',
[ (wordsize(64), 185943272, 5) ])