Make `catch` lazy in the action
authorBen Gamari <bgamari.foss@gmail.com>
Fri, 11 Mar 2016 09:38:10 +0000 (10:38 +0100)
committerBen Gamari <ben@smart-cactus.org>
Fri, 11 Mar 2016 12:20:16 +0000 (13:20 +0100)
commit30ee9102db2f16894912e19b9d16156824611bbb
treea89877f63604d33a32b0cbeec0cb1cc9b7f337e7
parenta1c4230e15cbf897b97903c8a1199a1cc91efd26
Make `catch` lazy in the action

Previously
```lang=haskell
catch (error "uh oh") (\(_ :: SomeException) -> print "it failed")
```
would unexpectedly fail with "uh oh" instead of the handler being run
due to the strictness of `catch` in its first argument. See #11555 for
details.

Test Plan: Validate

Reviewers: austin, hvr, simonpj

Reviewed By: simonpj

Subscribers: simonpj, thomie

Differential Revision: https://phabricator.haskell.org/D1973

GHC Trac Issues: #11555
libraries/base/Control/Exception/Base.hs
libraries/base/GHC/IO.hs
libraries/base/tests/.gitignore
libraries/base/tests/T11555.hs [new file with mode: 0644]
libraries/base/tests/T11555.stdout [new file with mode: 0644]
libraries/base/tests/all.T