[project @ 2002-10-11 08:04:29 by simonpj]
authorsimonpj <unknown>
Fri, 11 Oct 2002 08:04:29 +0000 (08:04 +0000)
committersimonpj <unknown>
Fri, 11 Oct 2002 08:04:29 +0000 (08:04 +0000)
Add a note about existential data constructors

ghc/docs/users_guide/glasgow_exts.sgml

index ef2028c..a3ff83c 100644 (file)
@@ -1898,8 +1898,13 @@ bindings. So this is illegal:
   f3 x = a==b where { Baz1 a b = x }
 </programlisting>
 
+Instead, use a <literal>case</literal> expression:
 
-You can only pattern-match
+<programlisting>
+  f3 x = case x of Baz1 a b -> a==b
+</programlisting>
+
+In general, you can only pattern-match
 on an existentially-quantified constructor in a <literal>case</literal> expression or
 in the patterns of a function definition.