Commit 68b0dc1
authored
docs: fix bifunctor bimap Result example (#646)
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
```1 parent 46ad6ed commit 68b0dc1
1 file changed
+1
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
97 | 97 | | |
98 | 98 | | |
99 | 99 | | |
100 | | - | |
| 100 | + | |
101 | 101 | | |
102 | 102 | | |
0 commit comments