« Previous | Next » 

Revision fb54b24a

IDfb54b24a7a64f7636434a07f57ed5a8fec34ac27

Added by Petr Pudlak almost 7 years ago

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 <>
Reviewed-by: Klaus Aehlig <>

Files

  • added
  • modified
  • copied
  • renamed
  • deleted

View differences