Skip to content
  • Petr Pudlak's avatar
    Improve liftIO of ResultT to catch IOErrors · fb54b24a
    Petr Pudlak authored
    
    
    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: default avatarPetr Pudlak <pudlak@google.com>
    Reviewed-by: default avatarKlaus Aehlig <aehlig@google.com>
    fb54b24a