Skip to content

Conversation

jasondown
Copy link

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
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant