Skip to content
  • Michael Snoyman's avatar
    d63e1de4
    Add instances for MonadCatch and MonadMask for Either (#56) · d63e1de4
    Michael Snoyman authored and Ryan Scott's avatar Ryan Scott committed
    Came up in a discussion with @bitonic. There's no downside I can see to
    the MonadCatch instance. However, the MonadMask instance is a little bit
    more controversial, in that it's not actually doing any masking.
    However, it's impossible to know that it's not masking the async
    exceptions since there are no side-effects from the Either monad.
    
    Of course, by using unsafePerformIO, we could observe the difference,
    but I think that's a valid trade-off.
    
    One final argument against MonadMask for Either: it's probably not
    terribly useful.
    d63e1de4
    Add instances for MonadCatch and MonadMask for Either (#56)
    Michael Snoyman authored and Ryan Scott's avatar Ryan Scott committed
    Came up in a discussion with @bitonic. There's no downside I can see to
    the MonadCatch instance. However, the MonadMask instance is a little bit
    more controversial, in that it's not actually doing any masking.
    However, it's impossible to know that it's not masking the async
    exceptions since there are no side-effects from the Either monad.
    
    Of course, by using unsafePerformIO, we could observe the difference,
    but I think that's a valid trade-off.
    
    One final argument against MonadMask for Either: it's probably not
    terribly useful.
To find the state of this project's repository at the time of any of these versions, check out the tags.
Loading