Skip to content

Commit 68b0dc1

Browse files
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

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

docsrc/content/abstraction-bifunctor.fsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,6 @@ open FSharpPlus
9797
let rInt10Str10 = bimap int string (10.0, 10)
9898

9999

100-
let resOk11 = bimap ((+) 1) string (Ok 10)
100+
let resOk11 = bimap string ((+) 1) (Ok 10)
101101
let rStrTrue = first string (true, 10)
102102
let rStr10 = second string (true, 10)

0 commit comments

Comments
 (0)