Skip to content

Commit 789cd7b

Browse files
committed
Formatting
1 parent 7c71bb4 commit 789cd7b

File tree

3 files changed

+18
-18
lines changed
  • src
    • FsToolkit.ErrorHandling.JobResult
    • FsToolkit.ErrorHandling.TaskResult
    • FsToolkit.ErrorHandling

3 files changed

+18
-18
lines changed

src/FsToolkit.ErrorHandling.JobResult/List.fs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,22 +27,20 @@ module List =
2727
let sequenceJobResultM xs = traverseJobResultM id xs
2828

2929

30-
let rec private traverseJobResultA' state (f : _ -> Job<Result<_,_>>) xs =
30+
let rec private traverseJobResultA' state (f: _ -> Job<Result<_, _>>) xs =
3131
match xs with
3232
| [] ->
3333
state
3434
|> JobResult.eitherMap List.rev List.rev
3535
| x :: xs -> job {
3636
let! s = state
37-
3837
let! fR = f x
3938

40-
4139
match s, fR with
4240
| Ok ys, Ok y -> return! traverseJobResultA' (JobResult.retn (y :: ys)) f xs
4341
| Error errs, Error e ->
4442
return! traverseJobResultA' (JobResult.returnError (e :: errs)) f xs
45-
| Ok _, Error e -> return! traverseJobResultA' (JobResult.returnError [e]) f xs
43+
| Ok _, Error e -> return! traverseJobResultA' (JobResult.returnError [ e ]) f xs
4644
| Error e, Ok _ -> return! traverseJobResultA' (JobResult.returnError e) f xs
4745
}
4846

src/FsToolkit.ErrorHandling.TaskResult/Task.fs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,10 @@ module Task =
1212
value
1313
|> Task.FromResult
1414

15-
let inline bind ([<InlineIfLambda>] f: 'a -> Task<'b>) (x: Task<'a>) =
16-
task {
17-
let! x = x
18-
return! f x
19-
}
15+
let inline bind ([<InlineIfLambda>] f: 'a -> Task<'b>) (x: Task<'a>) = task {
16+
let! x = x
17+
return! f x
18+
}
2019

2120
let inline bindV ([<InlineIfLambda>] f: 'a -> Task<'b>) (x: ValueTask<'a>) = task {
2221
let! x = x

src/FsToolkit.ErrorHandling/List.fs

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -51,15 +51,17 @@ module List =
5151

5252

5353
let rec private traverseResultA' state f xs =
54-
match xs with
55-
| [] -> state |> Result.eitherMap List.rev List.rev
56-
| x :: xs ->
54+
match xs with
55+
| [] ->
56+
state
57+
|> Result.eitherMap List.rev List.rev
58+
| x :: xs ->
5759

58-
match state, f x with
59-
| Ok ys, Ok y -> traverseResultA' (Ok(y :: ys)) f xs
60-
| Error errs, Error e -> traverseResultA' (Error(e :: errs)) f xs
61-
| Ok _, Error e -> traverseResultA' (Error [e]) f xs
62-
| Error e, Ok _ -> traverseResultA' (Error e) f xs
60+
match state, f x with
61+
| Ok ys, Ok y -> traverseResultA' (Ok(y :: ys)) f xs
62+
| Error errs, Error e -> traverseResultA' (Error(e :: errs)) f xs
63+
| Ok _, Error e -> traverseResultA' (Error [ e ]) f xs
64+
| Error e, Ok _ -> traverseResultA' (Error e) f xs
6365

6466
let rec private traverseAsyncResultA' state f xs =
6567
match xs with
@@ -70,11 +72,12 @@ module List =
7072
| x :: xs -> async {
7173
let! s = state
7274
let! fR = f x
75+
7376
match s, fR with
7477
| Ok ys, Ok y -> return! traverseAsyncResultA' (AsyncResult.retn (y :: ys)) f xs
7578
| Error errs, Error e ->
7679
return! traverseAsyncResultA' (AsyncResult.returnError (e :: errs)) f xs
77-
| Ok _, Error e -> return! traverseAsyncResultA' (AsyncResult.returnError [e]) f xs
80+
| Ok _, Error e -> return! traverseAsyncResultA' (AsyncResult.returnError [ e ]) f xs
7881
| Error e, Ok _ -> return! traverseAsyncResultA' (AsyncResult.returnError e) f xs
7982
}
8083

0 commit comments

Comments
 (0)