File tree Expand file tree Collapse file tree 2 files changed +8
-3
lines changed
src/FsToolkit.ErrorHandling
tests/FsToolkit.ErrorHandling.Tests Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -4,7 +4,6 @@ open FsToolkit.ErrorHandling
44
55[<AutoOpen>]
66module Validation =
7-
87 let inline (<!>)
98 ( [<InlineIfLambda>] mapper : 'okInput -> 'okOutput )
109 ( input : Validation < 'okInput , 'error >)
@@ -28,3 +27,9 @@ module Validation =
2827 ( input : Result < 'okInput , 'error >)
2928 : Validation < 'okOutput , 'error > =
3029 Validation.apply applier ( Validation.ofResult input)
30+
31+ let inline (>>= )
32+ ( input: Validation< 'okInput, 'error>)
33+ ([< InlineIfLambda>] binder: 'okInput -> Validation< 'okOutput, 'error>)
34+ : Validation< 'okOutput, 'error> =
35+ Validation.bind binder input
Original file line number Diff line number Diff line change @@ -104,14 +104,14 @@ let applyTests =
104104let operatorsTests =
105105
106106 testList " Validation Operators Tests" [
107- testCase " map & apply operators"
107+ testCase " map, apply & bind operators"
108108 <| fun _ ->
109109 createPostRequest
110110 <!> ( lift validLatR)
111111 <*> ( lift validLngR)
112112 <*> ( lift validTweetR)
113+ >>= ( fun tweet -> Ok tweet)
113114 |> Expect.hasOkValue validCreatePostRequest
114-
115115 testCase " map^ & apply^ operators"
116116 <| fun _ ->
117117 createPostRequest
You can’t perform that action at this time.
0 commit comments