[commit: testsuite] type-nats: Fix-up tests: previously they were ambiguous, and now GHC correctly spots this. (080d920)
Iavor Diatchki
diatchki at galois.com
Mon Mar 4 00:29:53 CET 2013
Repository : ssh://darcs.haskell.org//srv/darcs/testsuite
On branch : type-nats
http://hackage.haskell.org/trac/ghc/changeset/080d9202fb7e4ab46b34eefec6a11591961ceb47
>---------------------------------------------------------------
commit 080d9202fb7e4ab46b34eefec6a11591961ceb47
Author: Iavor S. Diatchki <iavor.diatchki at gmail.com>
Date: Sun Mar 3 15:25:17 2013 -0800
Fix-up tests: previously they were ambiguous, and now GHC correctly spots this.
>---------------------------------------------------------------
tests/typecheck/should_compile/TypeNatAC.hs | 40 +++++++++++-----------
tests/typecheck/should_compile/TypeNatBasics.hs | 12 +++---
2 files changed, 26 insertions(+), 26 deletions(-)
diff --git a/tests/typecheck/should_compile/TypeNatAC.hs b/tests/typecheck/should_compile/TypeNatAC.hs
index 05c87de..88b6daf 100644
--- a/tests/typecheck/should_compile/TypeNatAC.hs
+++ b/tests/typecheck/should_compile/TypeNatAC.hs
@@ -7,38 +7,38 @@ data S n = S
-- Commutativity ---------------------------------------------------------------
-c1 :: S (a + b) -> S (b + a)
-c1 = id
+c1 :: S a -> S b -> S (a + b) -> S (b + a)
+c1 _ _ = id
-c2 :: S (a * b) -> S (b * a)
-c2 = id
+c2 :: S a -> S b -> S (a * b) -> S (b * a)
+c2 _ _ = id
-- Associativity ---------------------------------------------------------------
-a1 :: S (a + (b + c)) -> S ((a + b) + c)
-a1 = id
+a1 :: S a -> S b -> S c -> S (a + (b + c)) -> S ((a + b) + c)
+a1 _ _ _ = id
-a2 :: S ((a + b) + c) -> S (a + (b + c))
-a2 = id
+a2 :: S a -> S b -> S c -> S ((a + b) + c) -> S (a + (b + c))
+a2 _ _ _ = id
-- Combinations ----------------------------------------------------------------
-ac1 :: S ((a + b) + c) -> S (a + (c + b))
-ac1 = id
+ac1 :: S a -> S b -> S c -> S ((a + b) + c) -> S (a + (c + b))
+ac1 _ _ _ = id
-ac2 :: S ((b + a) + c) -> S (a + (b + c))
-ac2 = id
+ac2 :: S a -> S b -> S c -> S ((b + a) + c) -> S (a + (b + c))
+ac2 _ _ _ = id
-ac3 :: S (c + (a + b)) -> S (a + (b + c))
-ac3 = id
+ac3 :: S a -> S b -> S c -> S (c + (a + b)) -> S (a + (b + c))
+ac3 _ _ _ = id
-ac4 :: S ((a + b) + c) -> S ((b + c) + a)
-ac4 = id
+ac4 :: S a -> S b -> S c -> S ((a + b) + c) -> S ((b + c) + a)
+ac4 _ _ _ = id
-ac5 :: S ((c + b) + a) -> S (a + (b + c))
-ac5 = id
+ac5 :: S a -> S b -> S c -> S ((c + b) + a) -> S (a + (b + c))
+ac5 _ _ _ = id
-ac6 :: S ((a + b) + c) -> S (c + (b + a))
-ac6 = id
+ac6 :: S a -> S b -> S c -> S ((a + b) + c) -> S (c + (b + a))
+ac6 _ _ _ = id
diff --git a/tests/typecheck/should_compile/TypeNatBasics.hs b/tests/typecheck/should_compile/TypeNatBasics.hs
index 4ce0c29..145992f 100644
--- a/tests/typecheck/should_compile/TypeNatBasics.hs
+++ b/tests/typecheck/should_compile/TypeNatBasics.hs
@@ -44,8 +44,8 @@ i4 = id
i5 :: S (x ^ 1) -> S x
i5 = id
-i6 :: (1 <= x) => S (0 ^ x) -> S 0
-i6 = id
+i6 :: (1 <= x) => S x -> S (0 ^ x) -> S 0
+i6 _ = id
i7 :: S (1 ^ x) -> S 1
i7 = id
@@ -55,11 +55,11 @@ i8 = id
--------------------------------------------------------------------------------
-c1 :: S (a + b) -> S (b + a)
-c1 = id
+c1 :: S a -> S b -> S (a + b) -> S (b + a)
+c1 _ _ = id
-c2 :: S (a * b) -> S (b * a)
-c2 = id
+c2 :: S a -> S b -> S (a * b) -> S (b * a)
+c2 _ _ = id
More information about the ghc-commits
mailing list