diff options
author | Matthew Pickering <matthewtpickering@gmail.com> | 2021-08-14 20:20:01 +0100 |
---|---|---|
committer | Marge Bot <ben+marge-bot@smart-cactus.org> | 2021-08-17 08:05:34 -0400 |
commit | acb188e0c02a114927d340dac78a68626c659cd3 (patch) | |
tree | 403ad95f07dca55a6086daa5d2791beb336a5f76 /compiler/GHC/Unit/Module/ModGuts.hs | |
parent | 31dc013fdec0cf2ddac1ba093c8a6933a0b62df2 (diff) | |
download | haskell-acb188e0c02a114927d340dac78a68626c659cd3.tar.gz |
ghci: Fix rec statements in interactive prompt
We desugar a recursive Stmt to somethign like
(a,_,c) <- mfix (\(a,b,_) -> do { ... ; return (a,b,c) })
...stuff after the rec...
The knot-tied tuple must contain
* All the variables that are used before they are bound in the `rec` block
* All the variables that are used after the entire `rec` block
In the case of GHCi, however, we don't know what variables will be used
after the `rec` (#20206). For example, we might have
ghci> rec { x <- e1; y <- e2 }
ghci> print x
ghci> print y
So we have to assume that *all* the variables bound in the `rec` are used
afterwards. We use `Nothing` in the argument to segmentRecStmts to signal
that all the variables are used.
Fixes #20206
Diffstat (limited to 'compiler/GHC/Unit/Module/ModGuts.hs')
0 files changed, 0 insertions, 0 deletions