« Previous | Next » 

Revision fb54b24a


Added by Petr Pudlak about 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 <>


  • added
  • modified
  • copied
  • renamed
  • deleted

View differences