diff options
author | simonpj <unknown> | 2004-12-22 16:59:22 +0000 |
---|---|---|
committer | simonpj <unknown> | 2004-12-22 16:59:22 +0000 |
commit | 20e39e0e07e4a8e9395894b2785d6675e4e3e3b3 (patch) | |
tree | dd82345461086491f435581008bfcd6641382ead /ghc/compiler/rename/RnBinds.lhs | |
parent | d7c402a3cedbe49345a34f2e58a3f3050638dcb4 (diff) | |
download | haskell-20e39e0e07e4a8e9395894b2785d6675e4e3e3b3.tar.gz |
[project @ 2004-12-22 16:58:34 by simonpj]
----------------------------------------
Add more scoped type variables
----------------------------------------
Now the top-level forall'd variables of a type signature scope
over the right hand side of that function.
f :: a -> a
f x = ....
The type variable 'a' is in scope in the RHS, and in f's patterns.
It's implied by -fglasgow-exts, but can also be switched off independently
using -fscoped-type-variables (and the -fno variant)
Diffstat (limited to 'ghc/compiler/rename/RnBinds.lhs')
-rw-r--r-- | ghc/compiler/rename/RnBinds.lhs | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/ghc/compiler/rename/RnBinds.lhs b/ghc/compiler/rename/RnBinds.lhs index 3d88d3231e..0e01812347 100644 --- a/ghc/compiler/rename/RnBinds.lhs +++ b/ghc/compiler/rename/RnBinds.lhs @@ -27,7 +27,7 @@ import RnExpr ( rnMatchGroup, rnMatch, rnGRHSs, checkPrecMatch ) import RnEnv ( bindLocatedLocalsRn, lookupLocatedBndrRn, lookupLocatedInstDeclBndr, lookupLocatedSigOccRn, bindPatSigTyVars, bindPatSigTyVarsFV, - bindLocalFixities, + bindLocalFixities, bindSigTyVarsFV, warnUnusedLocalBinds, mapFvRn, extendTyVarEnvFVRn, ) import CmdLineOpts ( DynFlag(..) ) @@ -298,7 +298,9 @@ mkBindVertex sigs (L loc (PatBind pat grhss ty)) names_bound_here = mkNameSet (collectPatBinders pat') in sigsForMe names_bound_here sigs `thenM` \ sigs_for_me -> - rnGRHSs PatBindRhs grhss `thenM` \ (grhss', fvs) -> + bindSigTyVarsFV sigs_for_me ( + rnGRHSs PatBindRhs grhss + ) `thenM` \ (grhss', fvs) -> returnM (names_bound_here, fvs `plusFV` pat_fvs, L loc (PatBind pat' grhss' ty), sigs_for_me @@ -312,7 +314,9 @@ mkBindVertex sigs (L loc (FunBind name inf matches)) names_bound_here = unitNameSet plain_name in sigsForMe names_bound_here sigs `thenM` \ sigs_for_me -> - rnMatchGroup (FunRhs plain_name) matches `thenM` \ (new_matches, fvs) -> + bindSigTyVarsFV sigs_for_me ( + rnMatchGroup (FunRhs plain_name) matches + ) `thenM` \ (new_matches, fvs) -> checkPrecMatch inf plain_name new_matches `thenM_` returnM (unitNameSet plain_name, fvs, |