@@ -323,12 +323,6 @@ module CancellableTaskValidation =
323323 let x = Result.mapError List.singleton result
324324 fun _ -> Task.FromResult( x)
325325
326- /// <summary>Lifts an item to a CancellableTaskValidation.</summary>
327- /// <param name="item">The item to be the ok result of the CancellableTaskValidation.</param>
328- /// <returns>A CancellableTaskValidation with the item as the result.</returns>
329- let inline ok ( item : 'ok ) : CancellableTaskValidation < 'ok , 'error > =
330- fun _ -> Task.FromResult( Ok item)
331-
332326 /// <summary>Lifts an item to a CancellableTaskValidation.</summary>
333327 /// <param name="error">The item to be the error result of the CancellableTaskValidation.</param>
334328 /// <returns>A CancellableTaskValidation with the item as the result.</returns>
@@ -338,11 +332,9 @@ module CancellableTaskValidation =
338332
339333 let inline ofChoice ( choice : Choice < 'ok , 'error >) : CancellableTaskValidation < 'ok , 'error > =
340334 match choice with
341- | Choice1Of2 x -> ok x
335+ | Choice1Of2 x -> singleton x
342336 | Choice2Of2 x -> error x
343337
344- let inline retn ( value : 'ok ) : CancellableTaskValidation < 'ok , 'error > = ok value
345-
346338
347339 let inline mapError
348340 ( [<InlineIfLambda>] errorMapper : 'errorInput -> 'errorOutput )
@@ -480,7 +472,7 @@ module CancellableTaskValidation =
480472
481473 return !
482474 result
483- |> Result.either ok ( fun _ -> ifError)
475+ |> Result.either singleton ( fun _ -> ifError)
484476 }
485477
486478 let inline orElseWith
@@ -493,7 +485,7 @@ module CancellableTaskValidation =
493485
494486 return !
495487 match result with
496- | Ok x -> ok x
488+ | Ok x -> singleton x
497489 | Error err -> ifErrorFunc err
498490 }
499491
@@ -928,7 +920,7 @@ module CTVMergeSourcesExtensionsTV1CV2 =
928920 (
929921 left : 'Awaiter1 ,
930922 [<InlineIfLambda>] right : CancellationToken -> 'Awaiter2
931- ) =
923+ ) =
932924 this.Source(
933925 // cancellableTask.Run(
934926 // cancellableTask.Bind(
@@ -950,17 +942,17 @@ module CTVMergeSourcesExtensionsTV1CV2 =
950942 let! struct ( l1 , r1 ) = cancellableTask.MergeSources( left, right)
951943 return Validation.zip l1 r1
952944 }
953- // fun ct -> Awaitable.GetTaskAwaiter(IcedTasks.Polyfill.Task.Tasks.TaskBuilder.task {
954- // let r1 = right ct
955- // let l1 = left
956- // let! struct (l1, r1) = IcedTasks.Polyfill.Task.Tasks.TaskBuilder.task.MergeSources(l1, r1)
945+ // fun ct -> Awaitable.GetTaskAwaiter(IcedTasks.Polyfill.Task.Tasks.TaskBuilder.task {
946+ // let r1 = right ct
947+ // let l1 = left
948+ // let! struct (l1, r1) = IcedTasks.Polyfill.Task.Tasks.TaskBuilder.task.MergeSources(l1, r1)
957949
958- // // let foo = cancellableTask.MergeSources(left, right) ct
959- // return Validation.zip l1 r1
960- // })
961- // |> ignore
950+ // // let foo = cancellableTask.MergeSources(left, right) ct
951+ // return Validation.zip l1 r1
952+ // })
953+ // |> ignore
962954
963- // Unchecked.defaultof<_>
955+ // Unchecked.defaultof<_>
964956 )
965957
966958
0 commit comments