Commit fa1a55ba authored by simonpj@microsoft.com's avatar simonpj@microsoft.com

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.
parent d49f9f5b
......@@ -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 }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment