diff options
Diffstat (limited to 'testsuite/tests/gadt/gadt20.hs')
-rw-r--r-- | testsuite/tests/gadt/gadt20.hs | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/testsuite/tests/gadt/gadt20.hs b/testsuite/tests/gadt/gadt20.hs new file mode 100644 index 0000000000..c754831ce5 --- /dev/null +++ b/testsuite/tests/gadt/gadt20.hs @@ -0,0 +1,19 @@ +{-# LANGUAGE GADTs, KindSignatures #-} + +-- Test for trac #810 +-- Should be able to infer bool :: Bool and integer :: Integer, so +-- we should know that they both have Show instances. + +module Foo where + +data Pair :: (* -> *) -> * where + Pair :: a b -> b -> Pair a + +data Sel :: * -> * where + A :: Sel Bool + B :: Sel Integer + +showSnd :: Pair Sel -> String +showSnd (Pair A bool) = show bool +showSnd (Pair B integer) = show integer + |