@@ -648,15 +648,6 @@ module CancellableTaskResultBuilderBase =
648648 continuation = ( fun v -> this.Return v)
649649 )
650650
651-
652- // [<NoEagerConstraintApplication>]
653- // member inline this.BindReturn
654- // (
655- // [<InlineIfLambda>] getAwaiterT: CancellationToken -> 'Awaiter,
656- // mapper: 'TResult1 -> 'TResult2
657- // ) : CancellableTaskResultBuilderBaseCode<_, _, _, _> =
658- // this.Bind((fun ct -> getAwaiterT ct), (fun v -> this.Return(mapper v)))
659-
660651 /// <summary>
661652 /// The entry point for the dynamic implementation of the corresponding operation. Do not use directly, only used when executing quotations that involve tasks or other reflective execution of F# code.
662653 /// </summary>
@@ -761,124 +752,12 @@ module CancellableTaskResultBuilderBase =
761752 : CancellableTaskResultBuilderBaseCode < _ , _ , _ , 'Builder > =
762753 this.Bind( awaiterT = awaiterT, continuation = ( fun v -> this.Return v))
763754
764- // [<NoEagerConstraintApplication>]
765- // member inline this.BindReturn
766- // (
767- // awaiterT: 'Awaiter,
768- // [<InlineIfLambda>] mapper: 'a -> 'TResult2
769- // ) : CancellableTaskResultBuilderBaseCode<'TResult2, 'TResult2, 'Error, 'Builder> =
770- // this.Bind(awaiterT = awaiterT, continuation = (fun v -> this.Return(mapper v)))
771-
772-
773755 /// <exclude/>
774756 [<AutoOpen>]
775757 module LowPriority =
776758 // Low priority extensions
777759 type CancellableTaskResultBuilderBase with
778760
779- // /// <summary>
780- // /// The entry point for the dynamic implementation of the corresponding operation. Do not use directly, only used when executing quotations that involve tasks or other reflective execution of F# code.
781- // /// </summary>
782- // [<NoEagerConstraintApplication>]
783- // static member inline BindDynamic
784- // (
785- // sm:
786- // byref<ResumableStateMachine<CancellableTaskResultBuilderBaseStateMachineData<'TOverall, 'Error, 'Builder>>>,
787- // [<InlineIfLambda>] getAwaiter: CancellationToken -> 'Awaiter,
788- // continuation:
789- // ('TResult1
790- // -> CancellableTaskResultBuilderBaseCode<'TOverall, 'TResult2, 'Error, 'Builder>)
791- // ) : bool =
792- // sm.Data.ThrowIfCancellationRequested()
793-
794- // let mutable awaiter = getAwaiter sm.Data.CancellationToken
795-
796- // let cont =
797- // (CancellableTaskResultBuilderBaseResumptionFunc<'TOverall, 'Error, _>(fun sm ->
798- // let result = Awaiter.GetResult awaiter
799-
800- // match result with
801- // | Ok result -> (continuation result).Invoke(&sm)
802- // | Error e ->
803- // sm.Data.Result <- Error e
804- // true
805- // ))
806-
807- // // shortcut to continue immediately
808- // if Awaiter.IsCompleted awaiter then
809- // cont.Invoke(&sm)
810- // else
811- // sm.ResumptionDynamicInfo.ResumptionData <-
812- // (awaiter :> ICriticalNotifyCompletion)
813-
814- // sm.ResumptionDynamicInfo.ResumptionFunc <- cont
815- // false
816-
817- // /// <summary>Creates A CancellableTask that runs computation, and when
818- // /// computation generates a result T, runs binder res.</summary>
819- // ///
820- // /// <remarks>A cancellation check is performed when the computation is executed.
821- // ///
822- // /// The existence of this method permits the use of let! in the
823- // /// cancellableTask { ... } computation expression syntax.</remarks>
824- // ///
825- // /// <param name="getAwaiter">The computation to provide an unbound result.</param>
826- // /// <param name="continuation">The function to bind the result of computation.</param>
827- // ///
828- // /// <returns>A CancellableTask that performs a monadic bind on the result
829- // /// of computation.</returns>
830- // [<NoEagerConstraintApplication>]
831- // member inline _.Bind
832- // (
833- // [<InlineIfLambda>] getAwaiterTResult: CancellationToken -> 'Awaiter,
834- // continuation:
835- // ('TResult1
836- // -> CancellableTaskResultBuilderBaseCode<'TOverall, 'TResult2, 'Error, 'Builder>)
837- // ) : CancellableTaskResultBuilderBaseCode<'TOverall, 'TResult2, 'Error, 'Builder> =
838-
839- // CancellableTaskResultBuilderBaseCode<'TOverall, 'TResult2, 'Error, 'Builder>(fun sm ->
840- // if __useResumableCode then
841- // //-- RESUMABLE CODE START
842- // sm.Data.ThrowIfCancellationRequested()
843- // // Get an awaiter from the Awaiter
844- // let mutable awaiter = getAwaiterTResult sm.Data.CancellationToken
845-
846- // let mutable __stack_fin = true
847-
848- // if not (Awaiter.IsCompleted awaiter) then
849- // // This will yield with __stack_yield_fin = false
850- // // This will resume with __stack_yield_fin = true
851- // let __stack_yield_fin = ResumableCode.Yield().Invoke(&sm)
852- // __stack_fin <- __stack_yield_fin
853-
854- // if __stack_fin then
855- // let result = Awaiter.GetResult awaiter
856-
857- // match result with
858- // | Ok result -> (continuation result).Invoke(&sm)
859- // | Error e ->
860- // sm.Data.Result <- Error e
861- // true
862- // else
863- // let mutable awaiter = awaiter :> ICriticalNotifyCompletion
864-
865- // MethodBuilder.AwaitUnsafeOnCompleted(
866- // &sm.Data.MethodBuilder,
867- // &awaiter,
868- // &sm
869- // )
870-
871- // false
872- // else
873- // CancellableTaskResultBuilderBase.BindDynamic(
874- // &sm,
875- // getAwaiterTResult,
876- // continuation
877- // )
878- // //-- RESUMABLE CODE END
879- // )
880-
881-
882761 /// <summary>Delegates to the input computation.</summary>
883762 ///
884763 /// <remarks>The existence of this method permits the use of return! in the
@@ -896,16 +775,6 @@ module CancellableTaskResultBuilderBase =
896775 continuation = ( fun v -> this.Return v)
897776 )
898777
899-
900- // [<NoEagerConstraintApplication>]
901- // member inline this.BindReturn
902- // (
903- // [<InlineIfLambda>] getAwaiterTResult: CancellationToken -> 'Awaiter,
904- // mapper: 'TResult1 -> 'TResult2
905- // ) : CancellableTaskResultBuilderBaseCode<_, _, _, _> =
906- // this.Bind((fun ct -> getAwaiterTResult ct), (fun v -> this.Return(mapper v)))
907-
908-
909778 /// <summary>Allows the computation expression to turn other types into CancellationToken -> 'Awaiter</summary>
910779 ///
911780 /// <remarks>This turns a CancellationToken -> 'Awaitable into a CancellationToken -> 'Awaiter.</remarks>
@@ -1060,18 +929,6 @@ module CancellableTaskResultBuilderBase =
1060929 : CancellableTaskResultBuilderBaseCode < _ , _ , _ , 'Builder > =
1061930 this.Bind( awaiterTResult = awaiterTResult, continuation = ( fun v -> this.Return v))
1062931
1063- // [<NoEagerConstraintApplication>]
1064- // member inline this.BindReturn
1065- // (
1066- // awaiterTResult: 'Awaiter,
1067- // [<InlineIfLambda>] mapper: 'a -> 'TResult2
1068- // ) : CancellableTaskResultBuilderBaseCode<'TResult2, 'TResult2, 'Error, 'Builder> =
1069- // this.Bind(
1070- // awaiterTResult = awaiterTResult,
1071- // continuation = (fun v -> this.Return(mapper v))
1072- // )
1073-
1074-
1075932 /// <summary>Allows the computation expression to turn other types into CancellationToken -> 'Awaiter</summary>
1076933 ///
1077934 /// <remarks>This is the identify function.</remarks>
@@ -1213,71 +1070,6 @@ module CancellableTaskResultBuilderBase =
12131070 : Async < _ > =
12141071 Async.AwaitCancellableTaskResult t
12151072
1216-
1217- // type AsyncEx with
1218-
1219- // /// <summary>Return an asynchronous computation that will wait for the given task to complete and return
1220- // /// its result.</summary>
1221- // ///
1222- // /// <remarks>
1223- // /// This is based on <see href="https://github.com/fsharp/fslang-suggestions/issues/840">Async.Await overload (esp. AwaitTask without throwing AggregateException)</see>
1224- // /// </remarks>
1225- // static member inline AwaitCancellableTask
1226- // ([<InlineIfLambda>] t: CancellationToken -> Task<'T>)
1227- // =
1228- // asyncEx {
1229- // let! ct = Async.CancellationToken
1230- // return! t ct
1231- // }
1232-
1233- // /// <summary>Return an asynchronous computation that will wait for the given task to complete and return
1234- // /// its result.</summary>
1235- // ///
1236- // /// <remarks>
1237- // /// This is based on <see href="https://github.com/fsharp/fslang-suggestions/issues/840">Async.Await overload (esp. AwaitTask without throwing AggregateException)</see>
1238- // /// </remarks>
1239- // static member inline AwaitCancellableTask
1240- // ([<InlineIfLambda>] t: CancellationToken -> Task)
1241- // =
1242- // asyncEx {
1243- // let! ct = Async.CancellationToken
1244- // return! t ct
1245- // }
1246-
1247- // type Microsoft.FSharp.Control.Async with
1248-
1249- // /// <summary>Return an asynchronous computation that will wait for the given task to complete and return
1250- // /// its result.</summary>
1251- // static member inline AwaitCancellableTask
1252- // ([<InlineIfLambda>] t: CancellationToken -> Task<'T>)
1253- // =
1254- // async {
1255- // let! ct = Async.CancellationToken
1256-
1257- // return!
1258- // t ct
1259- // |> Async.AwaitTask
1260- // }
1261-
1262- // /// <summary>Return an asynchronous computation that will wait for the given task to complete and return
1263- // /// its result.</summary>
1264- // static member inline AwaitCancellableTask
1265- // ([<InlineIfLambda>] t: CancellationToken -> Task)
1266- // =
1267- // async {
1268- // let! ct = Async.CancellationToken
1269-
1270- // return!
1271- // t ct
1272- // |> Async.AwaitTask
1273- // }
1274-
1275- // /// <summary>Runs an asynchronous computation, starting on the current operating system thread.</summary>
1276- // static member inline AsCancellableTask
1277- // (computation: Async<'T>)
1278- // : CancellationToken -> Task<_> =
1279- // fun ct -> Async.StartImmediateAsTask(computation, cancellationToken = ct)
1280-
12811073 // High priority extensions
12821074 type CancellableTaskResultBuilderBase with
12831075
0 commit comments