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
+
1
4
[<RequireQualifiedAccess>]
2
5
module FsToolkit.ErrorHandling.Seq
3
6
@@ -62,10 +65,18 @@ let inline traverseResultA' state ([<InlineIfLambda>] f: 'okInput -> Result<'okO
62
65
let folder state x =
63
66
match state, f x with
64
67
| Error errors, Error e ->
65
- Seq.append errors ( Seq.singleton e)
68
+ seq {
69
+ e
70
+ yield ! Seq.rev errors
71
+ }
72
+ |> Seq.rev
66
73
|> Error
67
74
| Ok oks, Ok ok ->
68
- Seq.append oks ( Seq.singleton ok)
75
+ seq {
76
+ ok
77
+ yield ! Seq.rev oks
78
+ }
79
+ |> Seq.rev
69
80
|> Ok
70
81
| Ok _, Error e ->
71
82
Seq.singleton e
@@ -167,10 +178,18 @@ let inline traverseAsyncResultA'
167
178
return
168
179
match state, result with
169
180
| Error errors, Error e ->
170
- Seq.append errors ( Seq.singleton e)
181
+ seq {
182
+ e
183
+ yield ! Seq.rev errors
184
+ }
185
+ |> Seq.rev
171
186
|> Error
172
187
| Ok oks, Ok ok ->
173
- Seq.append oks ( Seq.singleton ok)
188
+ seq {
189
+ ok
190
+ yield ! Seq.rev oks
191
+ }
192
+ |> Seq.rev
174
193
|> Ok
175
194
| Ok _, Error e ->
176
195
Seq.singleton e
You can’t perform that action at this time.
0 commit comments