summaryrefslogtreecommitdiff
path: root/testsuite/tests/partial-sigs
diff options
context:
space:
mode:
authorSimon Peyton Jones <simonpj@microsoft.com>2017-05-25 16:18:06 +0100
committerSimon Peyton Jones <simonpj@microsoft.com>2017-05-26 12:37:48 +0100
commitad14efd539377aaf472ad69449dcaf3e679b0e51 (patch)
tree8db1807c108abb62225820bd3780209d969f541b /testsuite/tests/partial-sigs
parent226860e786ccb2c5660b64c9cf66e58eaf4dc672 (diff)
downloadhaskell-ad14efd539377aaf472ad69449dcaf3e679b0e51.tar.gz
Some tidying up of type pretty-printing
Triggered by the changes in #13677, I ended up doing a bit of refactoring in type pretty-printing. * We were using TyOpPrec and FunPrec rather inconsitently, so I made it consisent. * That exposed the fact that we were a bit undecided about whether to print a + b -> c + d vs (a+b) -> (c+d) and similarly a ~ [b] => blah vs (a ~ [b]) => blah I decided to make TyOpPrec and FunPrec compare equal (in BasicTypes), so (->) is treated as equal precedence with other type operators, so you get the unambiguous forms above, even though they have more parens. We could readily reverse this decision. See Note [Type operator precedence] in BasicTypes * I fixed a bug in pretty-printing of HsType where some parens were omitted by mistake.
Diffstat (limited to 'testsuite/tests/partial-sigs')
-rw-r--r--testsuite/tests/partial-sigs/should_compile/DataFamilyInstanceLHS.stderr4
-rw-r--r--testsuite/tests/partial-sigs/should_compile/EqualityConstraint.stderr2
-rw-r--r--testsuite/tests/partial-sigs/should_compile/NamedWildcardInDataFamilyInstanceLHS.stderr4
3 files changed, 5 insertions, 5 deletions
diff --git a/testsuite/tests/partial-sigs/should_compile/DataFamilyInstanceLHS.stderr b/testsuite/tests/partial-sigs/should_compile/DataFamilyInstanceLHS.stderr
index 7a76170f17..4c946a70bb 100644
--- a/testsuite/tests/partial-sigs/should_compile/DataFamilyInstanceLHS.stderr
+++ b/testsuite/tests/partial-sigs/should_compile/DataFamilyInstanceLHS.stderr
@@ -3,11 +3,11 @@ TYPE SIGNATURES
DataFamilyInstanceLHS.B :: MyKind
DataFamilyInstanceLHS.SingA ::
forall (_ :: MyKind).
- _ ~ 'A =>
+ (_ ~ 'A) =>
DataFamilyInstanceLHS.R:SingMyKind_ _
DataFamilyInstanceLHS.SingB ::
forall (_ :: MyKind).
- _ ~ 'B =>
+ (_ ~ 'B) =>
DataFamilyInstanceLHS.R:SingMyKind_ _
foo :: Sing 'A
TYPE CONSTRUCTORS
diff --git a/testsuite/tests/partial-sigs/should_compile/EqualityConstraint.stderr b/testsuite/tests/partial-sigs/should_compile/EqualityConstraint.stderr
index 3ba61f598e..17e9d5a3ff 100644
--- a/testsuite/tests/partial-sigs/should_compile/EqualityConstraint.stderr
+++ b/testsuite/tests/partial-sigs/should_compile/EqualityConstraint.stderr
@@ -1,5 +1,5 @@
TYPE SIGNATURES
- foo :: forall a. a ~ Bool => (a, Bool)
+ foo :: forall a. (a ~ Bool) => (a, Bool)
TYPE CONSTRUCTORS
COERCION AXIOMS
Dependent modules: []
diff --git a/testsuite/tests/partial-sigs/should_compile/NamedWildcardInDataFamilyInstanceLHS.stderr b/testsuite/tests/partial-sigs/should_compile/NamedWildcardInDataFamilyInstanceLHS.stderr
index 8b8bebe55f..2990f7eb5e 100644
--- a/testsuite/tests/partial-sigs/should_compile/NamedWildcardInDataFamilyInstanceLHS.stderr
+++ b/testsuite/tests/partial-sigs/should_compile/NamedWildcardInDataFamilyInstanceLHS.stderr
@@ -3,11 +3,11 @@ TYPE SIGNATURES
NamedWildcardInDataFamilyInstanceLHS.B :: MyKind
NamedWildcardInDataFamilyInstanceLHS.SingA ::
forall (_a :: MyKind).
- _a ~ 'A =>
+ (_a ~ 'A) =>
NamedWildcardInDataFamilyInstanceLHS.R:SingMyKind_a _a
NamedWildcardInDataFamilyInstanceLHS.SingB ::
forall (_a :: MyKind).
- _a ~ 'B =>
+ (_a ~ 'B) =>
NamedWildcardInDataFamilyInstanceLHS.R:SingMyKind_a _a
TYPE CONSTRUCTORS
data MyKind = A | B