diff options
Diffstat (limited to 'testsuite/tests/gadt/gadt3.hs')
-rw-r--r-- | testsuite/tests/gadt/gadt3.hs | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/testsuite/tests/gadt/gadt3.hs b/testsuite/tests/gadt/gadt3.hs new file mode 100644 index 0000000000..b58301e131 --- /dev/null +++ b/testsuite/tests/gadt/gadt3.hs @@ -0,0 +1,18 @@ +{-# LANGUAGE GADTs #-} + +module ShouldCompile where + +data T where + T1 :: Int -> T + T2 :: Bool -> Bool -> T + +data S a where + S1 :: a -> S a + S2 :: Int -> S Int + +f (T1 i) = i>0 +f (T2 a b) = a && b + +g :: S a -> a +g (S1 x) = x +g (S2 i) = i |