summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Peyton Jones <simonpj@microsoft.com>2016-03-25 10:22:07 +0000
committerSimon Peyton Jones <simonpj@microsoft.com>2016-03-25 10:22:58 +0000
commitb416630faf92b5366fcc48941fa54b87f13994f8 (patch)
tree437563704508e48ccd18f9d7542878143e19ca97
parent067335a6724a406cbe0a956def8972682f531255 (diff)
downloadhaskell-b416630faf92b5366fcc48941fa54b87f13994f8.tar.gz
Test Trac #11728
-rw-r--r--testsuite/tests/ghci/scripts/T11728.hs30
-rw-r--r--testsuite/tests/ghci/scripts/T11728.script1
-rwxr-xr-xtestsuite/tests/ghci/scripts/all.T1
3 files changed, 32 insertions, 0 deletions
diff --git a/testsuite/tests/ghci/scripts/T11728.hs b/testsuite/tests/ghci/scripts/T11728.hs
new file mode 100644
index 0000000000..367a9db136
--- /dev/null
+++ b/testsuite/tests/ghci/scripts/T11728.hs
@@ -0,0 +1,30 @@
+{-# LANGUAGE UndecidableInstances, PatternSynonyms, GADTs #-}
+
+module T11728 where
+
+import Data.Kind
+import Data.Int
+import GHC.TypeLits
+import Text.Show.Functions
+
+data Ty ty where
+ I :: Ty Int
+ A :: Ty a -> Ty [a]
+
+class GetTy ty where getTy :: Ty ty
+instance GetTy Int where getTy = I
+instance GetTy ty => GetTy [ty] where
+ getTy = A getTy
+
+data E a where
+ UnOp :: Unary a b -> (E a -> E b)
+
+pattern LEN :: () => (GetTy a) => E [a] -> E Int
+pattern LEN xs <- UnOp (Un OpLen _) xs where
+ LEN xs = UnOp (Un OpLen length) xs
+
+data Unary a b where
+ Un :: (GetTy a, GetTy b) => UnOp a b -> (a -> b) -> Unary a b
+
+data UnOp a b where
+ OpLen :: GetTy a => UnOp [a] Int
diff --git a/testsuite/tests/ghci/scripts/T11728.script b/testsuite/tests/ghci/scripts/T11728.script
new file mode 100644
index 0000000000..fc96b813f6
--- /dev/null
+++ b/testsuite/tests/ghci/scripts/T11728.script
@@ -0,0 +1 @@
+:l T11728
diff --git a/testsuite/tests/ghci/scripts/all.T b/testsuite/tests/ghci/scripts/all.T
index f6de93b675..8fab9566a2 100755
--- a/testsuite/tests/ghci/scripts/all.T
+++ b/testsuite/tests/ghci/scripts/all.T
@@ -247,3 +247,4 @@ test('T11389', req_interp, run_command, ['$MAKE -s --no-print-directory T11389']
test('T11524a', normal, ghci_script, ['T11524a.script'])
test('T11456', normal, ghci_script, ['T11456.script'])
test('TypeAppData', normal, ghci_script, ['TypeAppData.script'])
+test('T11728', normal, ghci_script, ['T11728.script'])