New Try monad and updated TryT transformer
Pre-release
Pre-release
I've re-added a Try<A>
monad (I always intended to re-add it, just hadn't got around to it). And I've and reimplemented the TryT<M, A>
monad-transformer in terms of Try
(K<M, Try<A>>
), previously it was implemented in terms of Fin
(Func<K<M, Fin<A>>>
).
I have also:
- Added
Match
andIfFail
methods for pattern matching on the success/fail state. - Added
|
operator@catch
overrides to allow for easy error handling.
The IO
monad also has a .Try()
method that will run the IO
monad in a try/catch block returning IO<Fin<A>>
for more manual handling of IO errors.
Still needs some in-depth testing to make sure all exceptions are captured, but it's effectively feature complete.