From: simonpj Date: Fri, 11 Oct 2002 08:04:29 +0000 (+0000) Subject: [project @ 2002-10-11 08:04:29 by simonpj] X-Git-Tag: Approx_11550_changesets_converted~1571 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=a8cf15f207bb5b3d7173cf8e2f9314ad9a80d40b;p=ghc-hetmet.git [project @ 2002-10-11 08:04:29 by simonpj] Add a note about existential data constructors --- diff --git a/ghc/docs/users_guide/glasgow_exts.sgml b/ghc/docs/users_guide/glasgow_exts.sgml index ef2028c..a3ff83c 100644 --- a/ghc/docs/users_guide/glasgow_exts.sgml +++ b/ghc/docs/users_guide/glasgow_exts.sgml @@ -1898,8 +1898,13 @@ bindings. So this is illegal: f3 x = a==b where { Baz1 a b = x } +Instead, use a case expression: -You can only pattern-match + + f3 x = case x of Baz1 a b -> a==b + + +In general, you can only pattern-match on an existentially-quantified constructor in a case expression or in the patterns of a function definition.