From a8cf15f207bb5b3d7173cf8e2f9314ad9a80d40b Mon Sep 17 00:00:00 2001 From: simonpj Date: Fri, 11 Oct 2002 08:04:29 +0000 Subject: [PATCH] [project @ 2002-10-11 08:04:29 by simonpj] Add a note about existential data constructors --- ghc/docs/users_guide/glasgow_exts.sgml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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. -- 1.7.10.4