diff options
author | John Ericson <John.Ericson@Obsidian.Systems> | 2020-04-22 00:58:25 -0400 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2020-05-08 15:29:36 -0400 |
commit | 4e9aef9ea732e8157ee0b7fbb85b2cdfbf49de5f (patch) | |
tree | 5a41c9aca2cc0990652137128761e32e52a4286a | |
parent | 9749fe1223d182b1f8e7e4f7378df661c509f396 (diff) | |
download | haskell-4e9aef9ea732e8157ee0b7fbb85b2cdfbf49de5f.tar.gz |
HsSigWcTypeScoping: Pull in documentation from stray location
-rw-r--r-- | compiler/GHC/Rename/HsType.hs | 30 |
1 files changed, 16 insertions, 14 deletions
diff --git a/compiler/GHC/Rename/HsType.hs b/compiler/GHC/Rename/HsType.hs index 99b928af3f..90540eda08 100644 --- a/compiler/GHC/Rename/HsType.hs +++ b/compiler/GHC/Rename/HsType.hs @@ -80,14 +80,22 @@ to break several loop. ********************************************************* -} -data HsSigWcTypeScoping = AlwaysBind - -- ^ Always bind any free tyvars of the given type, - -- regardless of whether we have a forall at the top - | BindUnlessForall - -- ^ Unless there's forall at the top, do the same - -- thing as 'AlwaysBind' - | NeverBind - -- ^ Never bind any free tyvars +data HsSigWcTypeScoping + = AlwaysBind + -- ^ Always bind any free tyvars of the given type, regardless of whether we + -- have a forall at the top. + -- + -- For pattern type sigs and rules we /do/ want to bring those type + -- variables into scope, even if there's a forall at the top which usually + -- stops that happening, e.g: + -- + -- > \ (x :: forall a. a-> b) -> e + -- + -- Here we do bring 'b' into scope. + | BindUnlessForall + -- ^ Unless there's forall at the top, do the same thing as 'AlwaysBind' + | NeverBind + -- ^ Never bind any free tyvars rnHsSigWcType :: HsSigWcTypeScoping -> HsDocContext -> LHsSigWcType GhcPs -> RnM (LHsSigWcType GhcRn, FreeVars) @@ -96,12 +104,6 @@ rnHsSigWcType scoping doc sig_ty return (sig_ty', emptyFVs) rnHsSigWcTypeScoped :: HsSigWcTypeScoping - -- AlwaysBind: for pattern type sigs and rules we /do/ want - -- to bring those type variables into scope, even - -- if there's a forall at the top which usually - -- stops that happening - -- e.g \ (x :: forall a. a-> b) -> e - -- Here we do bring 'b' into scope -> HsDocContext -> LHsSigWcType GhcPs -> (LHsSigWcType GhcRn -> RnM (a, FreeVars)) -> RnM (a, FreeVars) |