diff options
author | Simon Peyton Jones <simonpj@microsoft.com> | 2011-09-07 16:13:34 +0100 |
---|---|---|
committer | Simon Peyton Jones <simonpj@microsoft.com> | 2011-09-07 16:13:34 +0100 |
commit | 400842c377bae85ffab6edc61af494cbe62123cb (patch) | |
tree | 95708fac10ed5745b7fc2f945c688bc2026db44f /testsuite/tests | |
parent | 8b5a2b4345ee9ba74f1274e7ed06e504240676c3 (diff) | |
download | haskell-400842c377bae85ffab6edc61af494cbe62123cb.tar.gz |
Test abstracting over a type variable of kind Constraint
Diffstat (limited to 'testsuite/tests')
-rw-r--r-- | testsuite/tests/typecheck/should_run/all.T | 1 | ||||
-rw-r--r-- | testsuite/tests/typecheck/should_run/tcrun046.hs | 17 | ||||
-rw-r--r-- | testsuite/tests/typecheck/should_run/tcrun046.stdout | 1 |
3 files changed, 19 insertions, 0 deletions
diff --git a/testsuite/tests/typecheck/should_run/all.T b/testsuite/tests/typecheck/should_run/all.T index aeeacb64ff..aacdc7d082 100644 --- a/testsuite/tests/typecheck/should_run/all.T +++ b/testsuite/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/testsuite/tests/typecheck/should_run/tcrun046.hs b/testsuite/tests/typecheck/should_run/tcrun046.hs new file mode 100644 index 0000000000..9eb4018adb --- /dev/null +++ b/testsuite/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/testsuite/tests/typecheck/should_run/tcrun046.stdout b/testsuite/tests/typecheck/should_run/tcrun046.stdout new file mode 100644 index 0000000000..bc59c12aa1 --- /dev/null +++ b/testsuite/tests/typecheck/should_run/tcrun046.stdout @@ -0,0 +1 @@ +False |