diff options
Diffstat (limited to 'testsuite/tests/th/T19363.hs')
-rw-r--r-- | testsuite/tests/th/T19363.hs | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/testsuite/tests/th/T19363.hs b/testsuite/tests/th/T19363.hs new file mode 100644 index 0000000000..41cd26c715 --- /dev/null +++ b/testsuite/tests/th/T19363.hs @@ -0,0 +1,35 @@ +{-# Language PatternSynonyms #-} +{-# Language TemplateHaskell #-} +{-# Language TypeFamilies #-} +{-# Language TypeOperators #-} + +module Main where + +import Language.Haskell.TH + +main = runQ [d| data Operator = (:*) Int | (:**) { (^**) :: Int } + + data (%*%) = (:%*%) + {-# COMPLETE (:%*%) :: (%*%) #-} + {-# ANN type (%*%) "yargh" #-} + + f = (:**) { (^**) = 42 } + infix 5 `f` + + (%%) :: [a] -> [a] -> [a] + (%%) = (++) + {-# INLINE (%%) #-} + {-# SPECIALISE (%%) :: String -> String -> String #-} + {-# ANN (%%) "blah" #-} + + g (:**) { (^**) = x } = x + + pattern a `H` b = (a, b) + pattern (:***) { (^***) } <- (:**) (^***) where + (:***) (^***) = (:**) (^***) + + foreign import ccall unsafe "blah" (<^>) :: Int + + type family (<%>) a + type (<%%>) a = a + |] >>= putStrLn . pprint |