diff options
author | Simon Peyton Jones <simonpj@microsoft.com> | 2012-05-11 18:02:18 +0100 |
---|---|---|
committer | Simon Peyton Jones <simonpj@microsoft.com> | 2012-05-11 18:02:31 +0100 |
commit | fc8959acae02605c71b775c8d403e38b5cc6fecd (patch) | |
tree | ed1184e995c279510d1684b78effa83dfc101193 /compiler/parser/Parser.y.pp | |
parent | c1e928e4d6278d574b4e171b2da335cec6711fb8 (diff) | |
download | haskell-fc8959acae02605c71b775c8d403e38b5cc6fecd.tar.gz |
Refactor LHsTyVarBndrs to fix Trac #6081
This is really a small change, but it touches a lot of files quite
significantly. The real goal is to put the implicitly-bound kind
variables of a data/class decl in the right place, namely on the
LHsTyVarBndrs type, which now looks like
data LHsTyVarBndrs name
= HsQTvs { hsq_kvs :: [Name]
, hsq_tvs :: [LHsTyVarBndr name]
}
This little change made the type checker neater in a number of
ways, but it was fiddly to push through the changes.
Diffstat (limited to 'compiler/parser/Parser.y.pp')
-rw-r--r-- | compiler/parser/Parser.y.pp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/compiler/parser/Parser.y.pp b/compiler/parser/Parser.y.pp index a9cb1d34b7..759d5449f9 100644 --- a/compiler/parser/Parser.y.pp +++ b/compiler/parser/Parser.y.pp @@ -728,9 +728,9 @@ data_or_newtype :: { Located NewOrData } : 'data' { L1 DataType } | 'newtype' { L1 NewType } -opt_kind_sig :: { Located (Maybe (HsBndrSig (LHsKind RdrName))) } +opt_kind_sig :: { Located (Maybe (LHsKind RdrName)) } : { noLoc Nothing } - | '::' kind { LL (Just (mkHsBSig $2)) } + | '::' kind { LL (Just $2) } -- tycl_hdr parses the header of a class or data type decl, -- which takes the form @@ -877,7 +877,7 @@ rule_var_list :: { [RuleBndr RdrName] } rule_var :: { RuleBndr RdrName } : varid { RuleBndr $1 } - | '(' varid '::' ctype ')' { RuleBndrSig $2 (mkHsBSig $4) } + | '(' varid '::' ctype ')' { RuleBndrSig $2 (mkHsWithBndrs $4) } ----------------------------------------------------------------------------- -- Warnings and deprecations (c.f. rules) @@ -1113,7 +1113,7 @@ tv_bndrs :: { [LHsTyVarBndr RdrName] } tv_bndr :: { LHsTyVarBndr RdrName } : tyvar { L1 (UserTyVar (unLoc $1)) } - | '(' tyvar '::' kind ')' { LL (KindedTyVar (unLoc $2) (mkHsBSig $4)) } + | '(' tyvar '::' kind ')' { LL (KindedTyVar (unLoc $2) $4) } fds :: { Located [Located (FunDep RdrName)] } : {- empty -} { noLoc [] } |