@@ -232,9 +232,6 @@ type ValueTaskValueOptionBuilderBase() =
232232 : CancellableValueTaskValueOption < 'T > =
233233 taskOption
234234
235- // member inline this.Source(taskOption: ValueTask<'T option>) : CancellableTaskOption<'T> =
236- // taskOption.AsTask()
237-
238235
239236type ValueTaskValueOptionBuilder () =
240237
@@ -355,76 +352,6 @@ type TaskOptionBuilder() =
355352 return ValueOption.toOption r
356353 }
357354
358-
359- // type BackgroundTaskOptionBuilder() =
360-
361- // inherit TaskOptionBuilderBase()
362-
363- // static member RunDynamic(code: TaskOptionCode<'T, 'T>) : CancellableTaskOption<'T> =
364- // // backgroundTask { .. } escapes to a background thread where necessary
365- // // See spec of ConfigureAwait(false) at https://devblogs.microsoft.com/dotnet/configureawait-faq/
366- // if
367- // isNull SynchronizationContext.Current
368- // && obj.ReferenceEquals(TaskScheduler.Current, TaskScheduler.Default)
369- // then
370- // TaskOptionBuilder.RunDynamic(code)
371- // else
372- // Task.Run<'T option>(fun () -> TaskOptionBuilder.RunDynamic(code))
373-
374-
375- // //// Same as TaskBuilder.Run except the start is inside Task.Run if necessary
376- // member inline _.Run(code: TaskOptionCode<'T, 'T>) : CancellableTaskOption<'T> =
377- // if __useResumableCode then
378- // __stateMachine<TaskOptionStateMachineData<'T>, CancellableTaskOption<'T>>
379- // (MoveNextMethodImpl<_>(fun sm ->
380- // //-- RESUMABLE CODE START
381- // __resumeAt sm.ResumptionPoint
382-
383- // try
384- // let __stack_code_fin = code.Invoke(&sm)
385-
386- // if
387- // __stack_code_fin
388- // && not sm.Data.IsTaskCompleted
389- // then
390- // sm.Data.MethodBuilder.SetResult(sm.Data.Result.Value)
391- // with exn ->
392- // sm.Data.MethodBuilder.SetException exn
393- // //-- RESUMABLE CODE END
394- // ))
395- // (SetStateMachineMethodImpl<_>(fun sm state ->
396- // sm.Data.MethodBuilder.SetStateMachine(state)
397- // ))
398- // (AfterCode<_, CancellableTaskOption<'T>>(fun sm ->
399- // // backgroundTask { .. } escapes to a background thread where necessary
400- // // See spec of ConfigureAwait(false) at https://devblogs.microsoft.com/dotnet/configureawait-faq/
401- // if
402- // isNull SynchronizationContext.Current
403- // && obj.ReferenceEquals(TaskScheduler.Current, TaskScheduler.Default)
404- // then
405- // sm.Data.MethodBuilder <- AsyncTaskOptionMethodBuilder<'T>.Create()
406- // sm.Data.MethodBuilder.Start(&sm)
407- // sm.Data.MethodBuilder.Task
408- // else
409- // let sm = sm // copy contents of state machine so we can capture it
410-
411- // Task.Run<'T option>(fun () ->
412- // let mutable sm = sm // host local mutable copy of contents of state machine on this thread pool thread
413- // sm.Data.MethodBuilder <- AsyncTaskOptionMethodBuilder<'T>.Create()
414- // sm.Data.MethodBuilder.Start(&sm)
415- // sm.Data.MethodBuilder.Task
416- // )
417- // ))
418- // else
419- // BackgroundTaskOptionBuilder.RunDynamic(code)
420-
421- // [<AutoOpen>]
422- // module TaskOptionBuilder =
423-
424- // let taskOption = ValueTaskValueOptionBuilder()
425- // let backgroundTaskOption = BackgroundTaskOptionBuilder()
426-
427-
428355[<AutoOpen>]
429356module TaskOptionCEExtensionsLowPriority =
430357 // Low priority extensions
@@ -618,8 +545,6 @@ module TaskOptionCEExtensionsHighPriority =
618545 ) =
619546 this.Bind( x, ( fun x -> this.Return( f x)))
620547
621- // member inline _.MergeSources(t1: CancellableTaskOption<'T>, t2: CancellableTaskOption<'T1>) = TaskOption.zip t1 t2
622-
623548 member inline this.ReturnFrom
624549 ( task : CancellableValueTaskValueOption < 'T >)
625550 : TaskOptionCode < 'T , 'T > =
0 commit comments