aboutsummaryrefslogtreecommitdiff
path: root/html-test/src/PatternSyns.hs
diff options
context:
space:
mode:
authorTim Baumann <tim@timbaumann.info>2017-08-06 11:33:38 +0200
committerAlexander Biehl <alexbiehl@gmail.com>2017-08-06 11:33:38 +0200
commit3fddb62913c72f29843335aa796c2e444ded1608 (patch)
treea3cccdacd8e546e527488009ebd5d9c815be46d3 /html-test/src/PatternSyns.hs
parent4d765e3cd0a735f9a7e8d13fb6633f9ee534fbfb (diff)
Fix: Generate pattern signatures for constructors exported as patterns (#663)
* Fix pretty-printing of pattern signatures Pattern synonyms can have up to two contexts, both having a different semantic meaning: The first holds the constraints required to perform the matching, the second contains the constraints provided by a successful pattern match. When the first context is empty but the second is not it is necessary to render the first, empty context. * Generate pattern synonym signatures for ctors exported as patterns This fixes #653. * Simplify extractPatternSyn It is not necessary to generate the simplest type signature since it will be simplified when pretty-printed. * Add changelog entries for PR #663 * Fix extractPatternSyn error message
Diffstat (limited to 'html-test/src/PatternSyns.hs')
-rw-r--r--html-test/src/PatternSyns.hs8
1 files changed, 7 insertions, 1 deletions
diff --git a/html-test/src/PatternSyns.hs b/html-test/src/PatternSyns.hs
index a8de113c..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,6 +15,12 @@ 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