From 404c633c38b6709cb304604adee8971360a794b2 Mon Sep 17 00:00:00 2001 From: Jason Down Date: Fri, 12 Sep 2025 12:19:27 -0400 Subject: [PATCH] docs: fix bifunctor bimap Result example 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 = 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 = Ok 11 ``` --- docsrc/content/abstraction-bifunctor.fsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docsrc/content/abstraction-bifunctor.fsx b/docsrc/content/abstraction-bifunctor.fsx index d50e49107..9267525bb 100644 --- a/docsrc/content/abstraction-bifunctor.fsx +++ b/docsrc/content/abstraction-bifunctor.fsx @@ -97,6 +97,6 @@ open FSharpPlus let rInt10Str10 = bimap int string (10.0, 10) -let resOk11 = bimap ((+) 1) string (Ok 10) +let resOk11 = bimap string ((+) 1) (Ok 10) let rStrTrue = first string (true, 10) let rStr10 = second string (true, 10) \ No newline at end of file