summaryrefslogtreecommitdiff
path: root/ghc
diff options
context:
space:
mode:
authorSebastian Graf <sgraf1337@gmail.com>2019-09-27 09:38:47 +0000
committerMarge Bot <ben+marge-bot@smart-cactus.org>2019-09-28 17:12:26 -0400
commitce64b397777408731c6dd3f5c55ea8415f9f565b (patch)
treea0a0b3a88145a913f4f6972ee679460fc5c0267e /ghc
parentc5d888d41eb7b39ea0d4c4aabd07ce8133bfeae6 (diff)
downloadhaskell-ce64b397777408731c6dd3f5c55ea8415f9f565b.tar.gz
`exprOkForSpeculation` for Note [IO hack in the demand analyser]
In #14998 I realised that the notion of speculative execution *exactly matches* eager evaluation of expressions in a case alternative where the scrutinee is an IO action. Normally we have to `deferIO` any result from that single case alternative to prevent this speculative execution, so we had a special case in place in the demand analyser that would check if the scrutinee was a prim-op, in which case we assumed that it would be ok to do the eager evaluation. Now we just check if the scrutinee is `exprOkForSpeculation`, corresponding to the notion that we want to push evaluation of the scrutinee *after* eagerly evaluating stuff from the case alternative. This fixes #14988, because it resolves the last open Item 4 there.
Diffstat (limited to 'ghc')
0 files changed, 0 insertions, 0 deletions