Skip to content

Commit 86b24a8

Browse files
Jimmy ByrdTheAngryByrd
authored andcommitted
Unrestrict source overloads to errors be exceptions
1 parent 11c2212 commit 86b24a8

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/FsToolkit.ErrorHandling.TaskResult/TaskResultCE.fs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ module TaskResultCEExtensions =
150150
/// <summary>
151151
/// Method lets us transform data types into our internal representation.
152152
/// </summary>
153-
member inline __.Source(asyncComputation : Async<_>) : Task<Result<_,_>> = asyncComputation |> TaskResult.ofAsync
153+
member inline __.Source(asyncComputation : Async<_>) : Task<Result<_,_>> = asyncComputation |> Async.StartAsTask |> Task.map Ok
154154

155155
/// <summary>
156156
/// Method lets us transform data types into our internal representation.

src/FsToolkit.ErrorHandling/AsyncResultCE.fs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,10 +125,10 @@ module AsyncResultCEExtensions =
125125
/// <summary>
126126
/// Method lets us transform data types into our internal representation.
127127
/// </summary>
128-
member inline _.Source(task : Task<_>) : Async<Result<_,_>> = task |> AsyncResult.ofTask
128+
member inline _.Source(task : Task<_>) : Async<Result<_,_>> = task |> Async.AwaitTask |> Async.map Ok
129129

130130
/// <summary>
131131
/// Method lets us transform data types into our internal representation.
132132
/// </summary>
133-
member inline _.Source(task : Task) : Async<Result<_,_>> = task |> AsyncResult.ofTaskAction
133+
member inline _.Source(task : Task) : Async<Result<_,_>> =task |> Async.AwaitTask |> Async.map Ok
134134
#endif

0 commit comments

Comments
 (0)