Skip to content

Commit 5a17cc7

Browse files
meridaioTheAngryByrd
authored andcommitted
add xml docs to new functions
1 parent f573418 commit 5a17cc7

File tree

3 files changed

+9
-0
lines changed

3 files changed

+9
-0
lines changed

src/FsToolkit.ErrorHandling.JobResult/JobResult.fs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,7 @@ module JobResult =
144144
Job.zip j1 j2
145145
|> Job.map(fun (r1, r2) -> Result.zip r1 r2)
146146

147+
/// Catches exceptions and maps them to the Error case using the provided function.
147148
let catch f x =
148149
x
149150
|> Job.catch
@@ -152,8 +153,10 @@ module JobResult =
152153
| Choice1Of2 (Error err) -> Error err
153154
| Choice2Of2 ex -> Error (f ex))
154155

156+
/// Lift Job to JobResult
155157
let ofJob x =
156158
x |> Job.map Ok
157159

160+
/// Lift Result to JobResult
158161
let ofResult (x : Result<_,_>) =
159162
x |> Job.singleton

src/FsToolkit.ErrorHandling.TaskResult/TaskResult.fs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,7 @@ module TaskResult =
138138
Task.zip x1 x2
139139
|> Task.map(fun (r1, r2) -> Result.zip r1 r2)
140140

141+
/// Catches exceptions and maps them to the Error case using the provided function.
141142
let catch f x =
142143
x
143144
|> Task.catch
@@ -146,8 +147,10 @@ module TaskResult =
146147
| Choice1Of2 (Error err) -> Error err
147148
| Choice2Of2 ex -> Error (f ex))
148149

150+
/// Lift Task to TaskResult
149151
let ofTask x =
150152
x |> Task.map Ok
151153

154+
/// Lift Result to TaskResult
152155
let ofResult (x : Result<_,_>) =
153156
x |> Task.singleton

src/FsToolkit.ErrorHandling/AsyncResult.fs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,7 @@ module AsyncResult =
148148
Async.zip x1 x2
149149
|> Async.map(fun (r1, r2) -> Result.zip r1 r2)
150150

151+
/// Catches exceptions and maps them to the Error case using the provided function.
151152
let catch f x =
152153
x
153154
|> Async.Catch
@@ -156,8 +157,10 @@ module AsyncResult =
156157
| Choice1Of2 (Error err) -> Error err
157158
| Choice2Of2 ex -> Error (f ex))
158159

160+
/// Lift Async to AsyncResult
159161
let ofAsync x =
160162
x |> Async.map Ok
161163

164+
/// Lift Result to AsyncResult
162165
let ofResult (x : Result<_,_>) =
163166
x |> Async.singleton

0 commit comments

Comments
 (0)