Revision fb54b24a
ID | fb54b24a7a64f7636434a07f57ed5a8fec34ac27 |
Improve liftIO of ResultT to catch IOErrors
Any IOErrors are now captured in ResultT's liftIO using try and converted into
'Bad'. This prevents IO exceptions from leaking into ResultT code and allows
them to be handled in a pure way inside ResultT's sum type.
It is still possible to avoid 'try' by using 'lift' or 'ResultT' directly,
therefore it's recommended to use 'liftIO' only.
Note that other, non-IO exceptions, such as PatternMatchFail, aren't handled.
This might be revised in future, if desired.
Signed-off-by: Petr Pudlak <pudlak@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>
Files
- added
- modified
- copied
- renamed
- deleted