Skip to content

Conversation

@jasondown
Copy link
Contributor

The original example let resOk11 = bimap ((+) 1) string (Ok 10) implied that the first function would be applied to the Result when it is Ok (returning Ok 11). However, this is backwards to the actual implementation:

let resOk11 = bimap ((+) 1) string (Ok 10) // val resOk11: Result<string,int> = Ok "10"

I have switched the order of the functions so that it produces the result expected (based on the name of the value binding resOk11):

let resOk11 = bimap string ((+) 1) (Ok 10) // val resOk11: Result<int,string> = Ok 11
The original example `let resOk11 = bimap ((+) 1) string (Ok 10)` implied that the first function would be applied to the Result when it is `Ok` (returning OK 11). However, this is backwards to the actual implementation: ```fsharp let resOk11 = bimap ((+) 1) string (Ok 10) // val resOk11: Result<string,int> = Ok "10" ``` I have switched the order of the functions so that it produces the result expected (based on the name of the value binding `resOk11`): ```fsharp let resOk11 = bimap string ((+) 1) (Ok 10) // val resOk11: Result<int,string> = Ok 11 ```
@wallymathieu wallymathieu merged commit 68b0dc1 into fsprojects:master Oct 26, 2025
4 checks passed
wallymathieu pushed a commit that referenced this pull request Oct 28, 2025
The original example `let resOk11 = bimap ((+) 1) string (Ok 10)` implied that the first function would be applied to the Result when it is `Ok` (returning OK 11). However, this is backwards to the actual implementation: ```fsharp let resOk11 = bimap ((+) 1) string (Ok 10) // val resOk11: Result<string,int> = Ok "10" ``` I have switched the order of the functions so that it produces the result expected (based on the name of the value binding `resOk11`): ```fsharp let resOk11 = bimap string ((+) 1) (Ok 10) // val resOk11: Result<int,string> = Ok 11 ```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants