File tree Expand file tree Collapse file tree 1 file changed +23
-4
lines changed
src/FsToolkit.ErrorHandling Expand file tree Collapse file tree 1 file changed +23
-4
lines changed Original file line number Diff line number Diff line change 1+ // See here for previous design disccusions:
2+ // 1. https://github.com/demystifyfp/FsToolkit.ErrorHandling/pull/277
3+
14[<RequireQualifiedAccess>]
25module FsToolkit.ErrorHandling.Seq
36
@@ -62,10 +65,18 @@ let inline traverseResultA' state ([<InlineIfLambda>] f: 'okInput -> Result<'okO
6265 let folder state x =
6366 match state, f x with
6467 | Error errors, Error e ->
65- Seq.append errors ( Seq.singleton e)
68+ seq {
69+ e
70+ yield ! Seq.rev errors
71+ }
72+ |> Seq.rev
6673 |> Error
6774 | Ok oks, Ok ok ->
68- Seq.append oks ( Seq.singleton ok)
75+ seq {
76+ ok
77+ yield ! Seq.rev oks
78+ }
79+ |> Seq.rev
6980 |> Ok
7081 | Ok _, Error e ->
7182 Seq.singleton e
@@ -167,10 +178,18 @@ let inline traverseAsyncResultA'
167178 return
168179 match state, result with
169180 | Error errors, Error e ->
170- Seq.append errors ( Seq.singleton e)
181+ seq {
182+ e
183+ yield ! Seq.rev errors
184+ }
185+ |> Seq.rev
171186 |> Error
172187 | Ok oks, Ok ok ->
173- Seq.append oks ( Seq.singleton ok)
188+ seq {
189+ ok
190+ yield ! Seq.rev oks
191+ }
192+ |> Seq.rev
174193 |> Ok
175194 | Ok _, Error e ->
176195 Seq.singleton e
You can’t perform that action at this time.
0 commit comments