You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[<Obsolete "From version 0.4.0 onward, 'ValueTask.FromResult' is deprecated in favor of 'ValueTask.fromResult'. It will be removed in an upcoming release.">]
38
31
let inlineFromResult(value:'T)= ValueTask<'T> value
39
32
40
33
[<Obsolete "From version 0.4.0 onward, 'ValueTask.ofIValueTaskSource' is deprecated in favor of 'ValueTask.ofSource'. It will be removed in an upcoming release.">]
41
34
let inlineofIValueTaskSource taskSource version = ofSource taskSource version
42
35
43
-
44
36
moduleTask =
45
37
let inlinefromResult(value:'U):Task<'U>= Task.FromResult value
46
38
let inlineofAsync(async:Async<'T>)=task{return! async }
@@ -72,14 +64,12 @@ module Async =
72
64
let inlineofTask(task:Task<'T>)= Async.AwaitTask task
73
65
let inlineofUnitTask(task:Task)= Async.AwaitTask task
74
66
let inlinetoTask(async:Async<'T>)=task{return! async }
75
-
let inlinebind binder (task:Async<'T>):Async<'U>= ExtraTopLevelOperators.async{return! binder task }
76
67
77
-
let inlineignore(async':Async<'T>)=async{
78
-
let!_= async'
79
-
return()
80
-
}
68
+
let inlineignore(async:Async<'T>)= Async.Ignore async
81
69
82
70
let inlinemap mapper (async:Async<'T>):Async<'U>= ExtraTopLevelOperators.async{
83
71
let!result= async
84
72
return mapper result
85
73
}
74
+
75
+
let inlinebind binder (async:Async<'T>):Async<'U>= ExtraTopLevelOperators.async{return! binder async }
Copy file name to clipboardExpand all lines: src/FSharp.Control.TaskSeq/Utils.fsi
+22-20Lines changed: 22 additions & 20 deletions
Original file line number
Diff line number
Diff line change
@@ -6,10 +6,12 @@ open System.Threading.Tasks.Sources
6
6
7
7
[<AutoOpen>]
8
8
moduleValueTaskExtensions =
9
-
typeSystem.Threading.Tasks.ValueTaskwith
10
9
11
-
/// (Extension member) Gets a task that has already completed successfully.
12
-
static member inlineCompletedTask:System.Threading.Tasks.ValueTask
10
+
/// Shims back-filling .NET 5+ functionality for use on netstandard2.1
11
+
typeValueTaskwith
12
+
13
+
/// (Extension member) Gets a ValueTask that has already completed successfully.
14
+
static member inlineCompletedTask:ValueTask
13
15
14
16
module ValueTask =
15
17
@@ -24,13 +26,13 @@ module ValueTask =
24
26
25
27
/// <summary>
26
28
/// The function <paramrefname="FromResult" /> is deprecated since version 0.4.0,
27
-
/// please use <paramrefname="fromSource" /> in its stead. See <seecref="T:FSharp.Control.ValueTask.fromResult" />.
29
+
/// please use <paramrefname="fromResult" /> in its stead. See <seecref="T:FSharp.Control.ValueTask.fromResult" />.
28
30
/// </summary>
29
31
[<Obsolete "From version 0.4.0 onward, 'ValueTask.FromResult' is deprecated in favor of 'ValueTask.fromResult'. It will be removed in an upcoming release.">]
30
32
val inlineFromResult:value:'T ->ValueTask<'T>
31
33
32
34
/// <summary>
33
-
/// Initialized a new instance of <seecref="ValueTask" /> with an <seecref="IValueTaskSource" /> representing
35
+
/// Initializes a new instance of <seecref="ValueTask" /> with an <seecref="IValueTaskSource" />
34
36
/// representing its operation.
35
37
/// </summary>
36
38
val inlineofSource:taskSource:IValueTaskSource<bool>->version:int16 ->ValueTask<bool>
@@ -42,21 +44,24 @@ module ValueTask =
42
44
[<Obsolete "From version 0.4.0 onward, 'ValueTask.ofIValueTaskSource' is deprecated in favor of 'ValueTask.ofSource'. It will be removed in an upcoming release.">]
43
45
val inlineofIValueTaskSource:taskSource:IValueTaskSource<bool>->version:int16 ->ValueTask<bool>
44
46
45
-
/// Creates a ValueTask form a Task<'T>
47
+
/// Creates a ValueTask from a Task<'T>
46
48
val inlineofTask:task:Task<'T>->ValueTask<'T>
47
49
48
-
/// Ignore a ValueTask<'T>, returns a non-generic ValueTask.
49
-
val inlineignore:vtask:ValueTask<'T>->ValueTask
50
+
/// Convert a ValueTask<'T> into a non-generic ValueTask, ignoring the result
51
+
val inlineignore:valueTask:ValueTask<'T>->ValueTask
50
52
51
53
moduleTask =
52
54
53
-
/// Convert an Async<'T> into a Task<'T>
55
+
/// Creates a Task<'U> that's completed successfully with the specified result.
56
+
val inlinefromResult:value:'U ->Task<'U>
57
+
58
+
/// Starts the `Async<'T>` computation, returning the associated `Task<'T>`
54
59
val inlineofAsync:async:Async<'T>->Task<'T>
55
60
56
-
/// Convert a unit-task into a Task<unit>
61
+
/// Convert a non-generic Task into a Task<unit>
57
62
val inlineofTask:task':Task ->Task<unit>
58
63
59
-
/// Convert a non-task function into a task-returning function
64
+
/// Convert a plain function into a task-returning function
60
65
val inlineapply:func:('a -> 'b) ->('a ->Task<'b>)
61
66
62
67
/// Convert a Task<'T> into an Async<'T>
@@ -66,8 +71,8 @@ module Task =
66
71
val inlinetoValueTask:task:Task<'T>->ValueTask<'T>
67
72
68
73
/// <summary>
69
-
/// Convert a ValueTask<'T> to a Task<'T>. To use a non-generic ValueTask,
0 commit comments