From fa1a55badb9e8869f74e4a63c38cf4837e122496 Mon Sep 17 00:00:00 2001 From: "simonpj@microsoft.com" Date: Mon, 17 Sep 2007 16:07:08 +0000 Subject: [PATCH] Loosen the syntax of types slightly This change allows you to write f :: (Eq a) => (Ord b) => a -> b -> b Previously you could only have a forall and context after '->' but not after '=>' which is strange and inconsistent. Making the parser a bit more generous didn't change the number of shift/reduce conflicts. tc236 tests. --- compiler/parser/Parser.y.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/compiler/parser/Parser.y.pp b/compiler/parser/Parser.y.pp index bfd0525..2bfb895 100644 --- a/compiler/parser/Parser.y.pp +++ b/compiler/parser/Parser.y.pp @@ -971,7 +971,7 @@ gentypedoc :: { LHsType RdrName } ctypedoc :: { LHsType RdrName } : 'forall' tv_bndrs '.' ctypedoc { LL $ mkExplicitHsForAllTy $2 (noLoc []) $4 } - | context '=>' gentypedoc { LL $ mkImplicitHsForAllTy $1 $3 } + | context '=>' ctypedoc { LL $ mkImplicitHsForAllTy $1 $3 } -- A type of form (context => type) is an *implicit* HsForAllTy | gentypedoc { $1 } -- 1.7.10.4