Add custom exception for fixIO
authorDavid Feuer <david.feuer@gmail.com>
Thu, 2 Nov 2017 16:06:56 +0000 (12:06 -0400)
committerBen Gamari <ben@smart-cactus.org>
Thu, 2 Nov 2017 17:20:26 +0000 (13:20 -0400)
commitb938576d151731b85314987fc550c17cfe824178
tree3cda2f27bd490c45cfad3f231e1e0be183cb53a4
parente0df569f7619dbef266139b9a6fa3ee9f632ea6e
Add custom exception for fixIO

Traditionally, `fixIO f` throws `BlockedIndefinitelyOnMVar` if
`f` is strict. This is not particularly friendly, since the
`MVar` in question is just part of the way `fixIO` happens to be
implemented. Instead, throw a new `FixIOException` with a better
explanation of the problem.

Reviewers: austin, hvr, bgamari

Subscribers: rwbarton, thomie

GHC Trac Issues: #14356

Differential Revision: https://phabricator.haskell.org/D4113
libraries/base/Control/Exception/Base.hs
libraries/base/GHC/IO/Exception.hs
libraries/base/System/IO.hs
testsuite/tests/mdo/should_fail/mdofail006.stderr
testsuite/tests/typecheck/should_compile/holes2.stderr