[commit: testsuite] no-pred-ty: Test abstracting over a type variable of kind Constraint (3ee5684)

Simon Peyton Jones simonpj at microsoft.com
Wed Sep 7 18:01:22 CEST 2011


Repository : ssh://darcs.haskell.org//srv/darcs/testsuite

On branch  : no-pred-ty

http://hackage.haskell.org/trac/ghc/changeset/3ee56843ec1492c5f5fd37eda05240b68d6220af

>---------------------------------------------------------------

commit 3ee56843ec1492c5f5fd37eda05240b68d6220af
Author: Simon Peyton Jones <simonpj at microsoft.com>
Date:   Wed Sep 7 16:13:34 2011 +0100

    Test abstracting over a type variable of kind Constraint

>---------------------------------------------------------------

 tests/typecheck/should_run/all.T                   |    1 +
 tests/typecheck/should_run/tcrun046.hs             |   17 +++++++++++++++++
 .../should_run/tcrun046.stdout}                    |    0 
 3 files changed, 18 insertions(+), 0 deletions(-)

diff --git a/tests/typecheck/should_run/all.T b/tests/typecheck/should_run/all.T
index aeeacb6..aacdc7d 100644
--- a/tests/typecheck/should_run/all.T
+++ b/tests/typecheck/should_run/all.T
@@ -68,6 +68,7 @@ test('tcrun042', normal, compile_and_run, [''])
 test('tcrun043', normal, compile_and_run, [''])
 test('tcrun044', normal, compile_and_run, [''])
 test('tcrun045', normal, compile_and_run, [''])
+test('tcrun046', normal, compile_and_run, [''])
 
 test('church', normal, compile_and_run, [''])
 test('testeq2', normal, compile_and_run, [''])
diff --git a/tests/typecheck/should_run/tcrun046.hs b/tests/typecheck/should_run/tcrun046.hs
new file mode 100644
index 0000000..9eb4018
--- /dev/null
+++ b/tests/typecheck/should_run/tcrun046.hs
@@ -0,0 +1,17 @@
+{-# LANGUAGE TypeFamilies, ConstraintKind, GADTs #-}
+
+module Main where
+
+-- Here we abstract over a *constraint*!
+-- T :: Constraint -> *
+
+data T a where
+  MkT :: a => T a
+
+f :: T (Ord x) -> x -> Bool
+f MkT x = x > x
+
+g :: T (Ord Int)
+g = MkT
+
+main = print (f g 4)
diff --git a/tests/codeGen/should_run/2080.stdout b/tests/typecheck/should_run/tcrun046.stdout
similarity index 100%
copy from tests/codeGen/should_run/2080.stdout
copy to tests/typecheck/should_run/tcrun046.stdout





More information about the Cvs-ghc mailing list