this library looks very intriguing and I am thinking of using it.
it seems to be in the perfect sweet spot between something a bit too basic (CSharpFunctionalExtensions) and almost haskell-ish (language-ext).
but what surprises me is that I cannot find any functions to construct an Either/Result out of a function call
sth like
Result.Try(() => 42); // Ok(42)
Result.Try(() => throw new InvalidOperationException("BOOM")); // Error(...)
...
Similar things could be done with async functions.
Same thing with Either, but its result will be Either<Exception, T> instead of Result
Many similar libs are implementing static helpers like that.
They usually also ignore fatal errors such as OOM that should not be caught
am I missing sth in the library from my research?
I can write own helpers of course but it seems to be absurd to introduce a new library and do that as one of the first actions 😉
this library looks very intriguing and I am thinking of using it.
it seems to be in the perfect sweet spot between something a bit too basic (CSharpFunctionalExtensions) and almost haskell-ish (language-ext).
but what surprises me is that I cannot find any functions to construct an Either/Result out of a function call
sth like
Similar things could be done with async functions.
Same thing with Either, but its result will be Either<Exception, T> instead of Result
Many similar libs are implementing static helpers like that.
They usually also ignore fatal errors such as OOM that should not be caught
am I missing sth in the library from my research?
I can write own helpers of course but it seems to be absurd to introduce a new library and do that as one of the first actions 😉