Fsdk: added UnwrapEither function#22
Fsdk: added UnwrapEither function#22webwarrior-ws wants to merge 1 commit intonblockchain:masterfrom
Conversation
Added UnwrapEither function.
| = | ||
| match eitherValue with | ||
| | SuccessfulValue result -> result | ||
| | FailureResult ex -> raise <| ReRaise ex |
There was a problem hiding this comment.
@webwarrior-ws FSharpUtil.ReRaise is for async jobs, not this; read the comment that is placed in ReRaise function please
There was a problem hiding this comment.
@webwarrior-ws FSharpUtil.ReRaise is for async jobs, not this; read the comment that is placed in ReRaise function please
That is what NOnion's UnwrapResult was using.
There was a problem hiding this comment.
@aarani before we use this in NOnion let's fix this ^
There was a problem hiding this comment.
I'm confused you want to make a commit to fix something you want to replace afterward?
There was a problem hiding this comment.
@webwarrior-ws @knocte should correct me but I guess raise ex is enough here
There was a problem hiding this comment.
I realised now what's wrong here. Look, you're mixing error-handling models. There's one model: exceptions, and then there's another model: Result types. With this thing you're mixing both models in one: a Failure monad that has an exception type??? This is super weird. Resullt types should contain error types which are normally DUs, not Exceptions.
There was a problem hiding this comment.
I agree that it's a questionable design choice. But it's used all over NOnion.
So what do we do with OperationResult and UnwrapResult?
There was a problem hiding this comment.
But it's used all over NOnion.
Let's work on fixing this first then. Taras can do it to offload you from it.
There was a problem hiding this comment.
Let's work on fixing this first then. Taras can do it to offload you from it.
Oops I thought I was replying to Afshin. Anyway, my comment still stands.
34818e9 to
e2b1c26
Compare
f2a13d9 to
b128a51
Compare
c516481 to
9ec0efc
Compare
bec6a6d to
87e807e
Compare
598f209 to
7c32dca
Compare
Added UnwrapEither function.