aboutsummaryrefslogtreecommitdiff
path: root/html-test/src/PatternSyns.hs
diff options
context:
space:
mode:
authoralexbiehl <alex.biehl@gmail.com>2017-08-21 20:05:42 +0200
committeralexbiehl <alex.biehl@gmail.com>2017-08-21 20:05:42 +0200
commit7a71af839bd71992a36d97650004c73bf11fa436 (patch)
treee64afbc9df5c97fde6ac6433e42f28df8a4acf49 /html-test/src/PatternSyns.hs
parentc8a01b83be52e45d3890db173ffe7b09ccd4f351 (diff)
parent740458ac4d2acf197f2ef8dc94a66f9b160b9c3c (diff)
Merge remote-tracking branch 'origin/master' into ghc-head
Diffstat (limited to 'html-test/src/PatternSyns.hs')
-rw-r--r--html-test/src/PatternSyns.hs13
1 files changed, 12 insertions, 1 deletions
diff --git a/html-test/src/PatternSyns.hs b/html-test/src/PatternSyns.hs
index 8af5eb23..bf0f7848 100644
--- a/html-test/src/PatternSyns.hs
+++ b/html-test/src/PatternSyns.hs
@@ -1,4 +1,4 @@
-{-# LANGUAGE PatternSynonyms, PolyKinds, TypeOperators #-}
+{-# LANGUAGE ExistentialQuantification, PatternSynonyms, PolyKinds, TypeOperators #-}
-- | Testing some pattern synonyms
module PatternSyns where
@@ -15,8 +15,19 @@ pattern Bar x = FooCtor (Foo x)
-- | Pattern synonym for (':<->')
pattern x :<-> y = (Foo x, Bar y)
+-- | BlubType is existentially quantified
+data BlubType = forall x. Show x => BlubCtor x
+
+-- | Pattern synonym for 'Blub' x
+pattern Blub x = BlubCtor x
+
-- | Doc for ('><')
data (a :: *) >< b = Empty
-- | Pattern for 'Empty'
pattern E = Empty
+
+-- | Earlier ghc versions didn't allow explicit signatures
+-- on pattern synonyms.
+pattern PatWithExplicitSig :: Eq somex => somex -> FooType somex
+pattern PatWithExplicitSig x = FooCtor x