-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fsdk: added UnwrapEither function #22
base: master
Are you sure you want to change the base?
Conversation
Added UnwrapEither function.
= | ||
match eitherValue with | ||
| SuccessfulValue result -> result | ||
| FailureResult ex -> raise <| ReRaise ex |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@aarani before we use this in NOnion let's fix this ^
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@aarani ping
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm confused you want to make a commit to fix something you want to replace afterward?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@webwarrior-ws @knocte should correct me but I guess raise ex
is enough here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.