1 people like it.
Like the snippet!
Vsync Computation Expression
The 'Vsync' (AKA, 'Variable Synchronization') computation expression that coheres into the Sync comp. expr. when SYNC is #defined, and into the Async comp. expr. otherwise.
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
78:
79:
80:
81:
82:
83:
84:
85:
86:
87:
88:
89:
90:
91:
92:
93:
94:
95:
96:
97:
98:
99:
100:
101:
102:
103:
104:
105:
106:
107:
108:
109:
110:
111:
112:
113:
114:
115:
116:
117:
118:
119:
120:
121:
122:
123:
124:
125:
126:
127:
128:
129:
130:
131:
132:
133:
|
namespace YourNamespaceHere
open System
open System.Diagnostics
open System.Threading
open System.Threading.Tasks
/// The 'Sync' builder for evaluating expressions in a synchronous style to aid debugging.
type [<Sealed>] Sync () =
member inline this.Bind (x, f) = f x
member inline this.Return x = x
member inline this.ReturnFrom x = x
member inline this.Zero () = ()
member inline this.Combine ((), ()) = ()
member inline this.Yield x = x
member inline this.YieldFrom x = x
member inline this.Run f = f ()
member inline this.Delay f = fun () -> f ()
member inline this.For (s, f) = for x in s do f x
member inline this.While (g, b) = while g () do this.Run b
member inline this.TryWith (b, h) = try this.Run b with exn -> h exn
member inline this.TryFinally (b, c) = try this.Run b finally c ()
member inline this.Using (d, b) = use u = d in b u
static member inline Ignore _ = ()
static member inline Sleep (t : int) = Thread.Sleep t
static member inline RunSynchronously x = x
static member inline StartAsTask x : _ Task = Task.Factory.StartNew (fun () -> x)
static member inline AwaitTask (t : _ Task) = t.Result
static member inline AwaitTask (t : Task) = t.Wait ()
static member inline Catch x = Choice1Of2 x
static member inline Parallel (s : _ seq) = s |> Seq.map (fun x -> Thread.Sleep 10; x) |> List.ofSeq |> Seq.ofList // Thread.Sleep keeps from soaking CPU
[<AutoOpen; CompilationRepresentation (CompilationRepresentationFlags.ModuleSuffix)>]
module Sync =
/// The Sync builder instance.
/// Used like: sync { return 0 }
let sync = Sync ()
/// The 'Vsync' (AKA, 'Variable Synchronization') cexpr that coheres into the Sync cexpr when SYNC is #defined, and
/// into the Async cexpr otherwise.
/// TODO: forward documentation from FSharp.Core and Marvel.
type [<Sealed>] Vsync () =
member inline this.Builder =
#if SYNC
sync
#else
async
#endif
member inline this.Bind (m, f) = this.Builder.Bind (m, f)
member inline this.Return x = this.Builder.Return x
member inline this.ReturnFrom m = this.Builder.ReturnFrom m
member inline this.Zero () = this.Builder.Zero ()
member inline this.Combine (a, b) = this.Builder.Combine (a, b)
#if SYNC
member inline this.Yield x = this.Builder.Yield x
member inline this.YieldFrom x = this.Builder.YieldFrom x
member inline this.Run f = this.Builder.Run f
#endif
member inline this.Delay f = this.Builder.Delay f
member inline this.For (m, f) = this.Builder.For (m, f)
member inline this.While (g, b) = this.Builder.While (g, b)
member inline this.TryWith (b, h) = this.Builder.TryWith (b, h)
member inline this.TryFinally (b, c) = this.Builder.TryFinally (b, c)
member inline this.Using (d, b) = this.Builder.Using (d, b)
static member inline Ignore m =
#if SYNC
Sync.Ignore m
#else
Async.Ignore m
#endif
static member inline Sleep t =
#if SYNC
Sync.Sleep t
#else
Async.Sleep t
#endif
static member inline RunSynchronously m =
#if SYNC
Sync.RunSynchronously m
#else
Async.RunSynchronously m
#endif
static member inline StartAsTask m : _ Task =
#if SYNC
Sync.StartAsTask m
#else
Async.StartAsTask m
#endif
static member inline AwaitTask (t : _ Task) =
#if SYNC
Sync.AwaitTask t
#else
Async.AwaitTask t
#endif
/// Catch an exception while binding m.
/// NOTE: the semantics between a Sync.Catch and an Async.Catch are remarkably different. Most notably, Sync.Catch
/// is just the application of Choice1Of2 to m since there is no evaluation taking place inside of it.
static member inline Catch m =
#if SYNC
Sync.Catch m
#else
Async.Catch m
#endif
static member inline Parallel s =
#if SYNC
Sync.Parallel s
#else
Async.Parallel s
#endif
[<AutoOpen; CompilationRepresentation (CompilationRepresentationFlags.ModuleSuffix)>]
module Vsync =
/// The Vsync builder instance.
/// Used like: vsync { return 0 }
let vsync = Vsync ()
/// The Vsync alias.
type Vsync<'a> =
#if SYNC
'a
#else
Async<'a>
#endif
|
namespace System
namespace System.Diagnostics
namespace System.Threading
namespace System.Threading.Tasks
Multiple items
type SealedAttribute =
inherit Attribute
new : unit -> SealedAttribute
new : value:bool -> SealedAttribute
member Value : bool
Full name: Microsoft.FSharp.Core.SealedAttribute
--------------------
new : unit -> SealedAttribute
new : value:bool -> SealedAttribute
Multiple items
type Sync =
new : unit -> Sync
member Bind : x:'s * f:('s -> 't) -> 't
member Combine : unit * unit -> unit
member Delay : f:(unit -> 'm) -> (unit -> 'm)
member For : s:seq<'l> * f:('l -> unit) -> unit
member Return : x:'r -> 'r
member ReturnFrom : x:'q -> 'q
member Run : f:(unit -> 'n) -> 'n
member TryFinally : b:(unit -> 'j) * c:(unit -> unit) -> 'j
member TryWith : b:(unit -> 'k) * h:(exn -> 'k) -> 'k
...
Full name: YourNamespaceHere.Sync
The 'Sync' builder for evaluating expressions in a synchronous style to aid debugging.
--------------------
new : unit -> Sync
val this : Sync
member Sync.Bind : x:'s * f:('s -> 't) -> 't
Full name: YourNamespaceHere.Sync.Bind
val x : 's
val f : ('s -> 't)
member Sync.Return : x:'r -> 'r
Full name: YourNamespaceHere.Sync.Return
val x : 'r
member Sync.ReturnFrom : x:'q -> 'q
Full name: YourNamespaceHere.Sync.ReturnFrom
val x : 'q
member Sync.Zero : unit -> unit
Full name: YourNamespaceHere.Sync.Zero
member Sync.Combine : unit * unit -> unit
Full name: YourNamespaceHere.Sync.Combine
member Sync.Yield : x:'p -> 'p
Full name: YourNamespaceHere.Sync.Yield
val x : 'p
member Sync.YieldFrom : x:'o -> 'o
Full name: YourNamespaceHere.Sync.YieldFrom
val x : 'o
member Sync.Run : f:(unit -> 'n) -> 'n
Full name: YourNamespaceHere.Sync.Run
val f : (unit -> 'n)
member Sync.Delay : f:(unit -> 'm) -> (unit -> 'm)
Full name: YourNamespaceHere.Sync.Delay
val f : (unit -> 'm)
member Sync.For : s:seq<'l> * f:('l -> unit) -> unit
Full name: YourNamespaceHere.Sync.For
val s : seq<'l>
val f : ('l -> unit)
val x : 'l
member Sync.While : g:(unit -> bool) * b:(unit -> unit) -> unit
Full name: YourNamespaceHere.Sync.While
val g : (unit -> bool)
val b : (unit -> unit)
member Sync.Run : f:(unit -> 'n) -> 'n
member Sync.TryWith : b:(unit -> 'k) * h:(exn -> 'k) -> 'k
Full name: YourNamespaceHere.Sync.TryWith
val b : (unit -> 'k)
val h : (exn -> 'k)
Multiple items
val exn : exn
--------------------
type exn = Exception
Full name: Microsoft.FSharp.Core.exn
member Sync.TryFinally : b:(unit -> 'j) * c:(unit -> unit) -> 'j
Full name: YourNamespaceHere.Sync.TryFinally
val b : (unit -> 'j)
val c : (unit -> unit)
member Sync.Using : d:'h * b:('h -> 'i) -> 'i (requires 'h :> IDisposable)
Full name: YourNamespaceHere.Sync.Using
val d : #IDisposable
val b : (#IDisposable -> 'i)
val u : #IDisposable
static member Sync.Ignore : 'g -> unit
Full name: YourNamespaceHere.Sync.Ignore
static member Sync.Sleep : t:int -> unit
Full name: YourNamespaceHere.Sync.Sleep
val t : int
Multiple items
val int : value:'T -> int (requires member op_Explicit)
Full name: Microsoft.FSharp.Core.Operators.int
--------------------
type int = int32
Full name: Microsoft.FSharp.Core.int
--------------------
type int<'Measure> = int
Full name: Microsoft.FSharp.Core.int<_>
Multiple items
type Thread =
inherit CriticalFinalizerObject
new : start:ThreadStart -> Thread + 3 overloads
member Abort : unit -> unit + 1 overload
member ApartmentState : ApartmentState with get, set
member CurrentCulture : CultureInfo with get, set
member CurrentUICulture : CultureInfo with get, set
member DisableComObjectEagerCleanup : unit -> unit
member ExecutionContext : ExecutionContext
member GetApartmentState : unit -> ApartmentState
member GetCompressedStack : unit -> CompressedStack
member GetHashCode : unit -> int
...
Full name: System.Threading.Thread
--------------------
Thread(start: ThreadStart) : unit
Thread(start: ParameterizedThreadStart) : unit
Thread(start: ThreadStart, maxStackSize: int) : unit
Thread(start: ParameterizedThreadStart, maxStackSize: int) : unit
Thread.Sleep(timeout: TimeSpan) : unit
Thread.Sleep(millisecondsTimeout: int) : unit
static member Sync.RunSynchronously : x:'f -> 'f
Full name: YourNamespaceHere.Sync.RunSynchronously
val x : 'f
static member Sync.StartAsTask : x:'e -> Task<'e>
Full name: YourNamespaceHere.Sync.StartAsTask
val x : 'e
Multiple items
type Task =
new : action:Action -> Task + 7 overloads
member AsyncState : obj
member ContinueWith : continuationAction:Action<Task> -> Task + 9 overloads
member CreationOptions : TaskCreationOptions
member Dispose : unit -> unit
member Exception : AggregateException
member Id : int
member IsCanceled : bool
member IsCompleted : bool
member IsFaulted : bool
...
Full name: System.Threading.Tasks.Task
--------------------
type Task<'TResult> =
inherit Task
new : function:Func<'TResult> -> Task<'TResult> + 7 overloads
member ContinueWith : continuationAction:Action<Task<'TResult>> -> Task + 9 overloads
member Result : 'TResult with get, set
static member Factory : TaskFactory<'TResult>
Full name: System.Threading.Tasks.Task<_>
--------------------
Task(action: Action) : unit
Task(action: Action, cancellationToken: CancellationToken) : unit
Task(action: Action, creationOptions: TaskCreationOptions) : unit
Task(action: Action<obj>, state: obj) : unit
Task(action: Action, cancellationToken: CancellationToken, creationOptions: TaskCreationOptions) : unit
Task(action: Action<obj>, state: obj, cancellationToken: CancellationToken) : unit
Task(action: Action<obj>, state: obj, creationOptions: TaskCreationOptions) : unit
Task(action: Action<obj>, state: obj, cancellationToken: CancellationToken, creationOptions: TaskCreationOptions) : unit
--------------------
Task(function: Func<'TResult>) : unit
Task(function: Func<'TResult>, cancellationToken: CancellationToken) : unit
Task(function: Func<'TResult>, creationOptions: TaskCreationOptions) : unit
Task(function: Func<obj,'TResult>, state: obj) : unit
Task(function: Func<'TResult>, cancellationToken: CancellationToken, creationOptions: TaskCreationOptions) : unit
Task(function: Func<obj,'TResult>, state: obj, cancellationToken: CancellationToken) : unit
Task(function: Func<obj,'TResult>, state: obj, creationOptions: TaskCreationOptions) : unit
Task(function: Func<obj,'TResult>, state: obj, cancellationToken: CancellationToken, creationOptions: TaskCreationOptions) : unit
Multiple items
property Task.Factory: TaskFactory
--------------------
property Task.Factory: TaskFactory<'TResult>
Multiple items
TaskFactory.StartNew<'TResult>(function: Func<'TResult>) : Task<'TResult>
(+0 other overloads)
TaskFactory.StartNew(action: Action) : Task
(+0 other overloads)
TaskFactory.StartNew<'TResult>(function: Func<obj,'TResult>, state: obj) : Task<'TResult>
(+0 other overloads)
TaskFactory.StartNew<'TResult>(function: Func<'TResult>, creationOptions: TaskCreationOptions) : Task<'TResult>
(+0 other overloads)
TaskFactory.StartNew<'TResult>(function: Func<'TResult>, cancellationToken: CancellationToken) : Task<'TResult>
(+0 other overloads)
TaskFactory.StartNew(action: Action<obj>, state: obj) : Task
(+0 other overloads)
TaskFactory.StartNew(action: Action, creationOptions: TaskCreationOptions) : Task
(+0 other overloads)
TaskFactory.StartNew(action: Action, cancellationToken: CancellationToken) : Task
(+0 other overloads)
TaskFactory.StartNew<'TResult>(function: Func<obj,'TResult>, state: obj, creationOptions: TaskCreationOptions) : Task<'TResult>
(+0 other overloads)
TaskFactory.StartNew<'TResult>(function: Func<obj,'TResult>, state: obj, cancellationToken: CancellationToken) : Task<'TResult>
(+0 other overloads)
--------------------
TaskFactory.StartNew(function: Func<'TResult>) : Task<'TResult>
TaskFactory.StartNew(function: Func<obj,'TResult>, state: obj) : Task<'TResult>
TaskFactory.StartNew(function: Func<'TResult>, creationOptions: TaskCreationOptions) : Task<'TResult>
TaskFactory.StartNew(function: Func<'TResult>, cancellationToken: CancellationToken) : Task<'TResult>
TaskFactory.StartNew(function: Func<obj,'TResult>, state: obj, creationOptions: TaskCreationOptions) : Task<'TResult>
TaskFactory.StartNew(function: Func<obj,'TResult>, state: obj, cancellationToken: CancellationToken) : Task<'TResult>
TaskFactory.StartNew(function: Func<'TResult>, cancellationToken: CancellationToken, creationOptions: TaskCreationOptions, scheduler: TaskScheduler) : Task<'TResult>
TaskFactory.StartNew(function: Func<obj,'TResult>, state: obj, cancellationToken: CancellationToken, creationOptions: TaskCreationOptions, scheduler: TaskScheduler) : Task<'TResult>
static member Sync.AwaitTask : t:Task<'d> -> 'd
Full name: YourNamespaceHere.Sync.AwaitTask
val t : Task<'d>
property Task.Result: 'd
static member Sync.AwaitTask : t:Task -> unit
Full name: YourNamespaceHere.Sync.AwaitTask
val t : Task
Task.Wait() : unit
Task.Wait(millisecondsTimeout: int) : bool
Task.Wait(cancellationToken: CancellationToken) : unit
Task.Wait(timeout: TimeSpan) : bool
Task.Wait(millisecondsTimeout: int, cancellationToken: CancellationToken) : bool
static member Sync.Catch : x:'b -> Choice<'b,'c>
Full name: YourNamespaceHere.Sync.Catch
val x : 'b
union case Choice.Choice1Of2: 'T1 -> Choice<'T1,'T2>
Multiple items
static member Sync.Parallel : s:seq<'a> -> seq<'a>
Full name: YourNamespaceHere.Sync.Parallel
--------------------
type Parallel =
static member For : fromInclusive:int * toExclusive:int * body:Action<int> -> ParallelLoopResult + 11 overloads
static member ForEach<'TSource> : source:IEnumerable<'TSource> * body:Action<'TSource> -> ParallelLoopResult + 19 overloads
static member Invoke : [<ParamArray>] actions:Action[] -> unit + 1 overload
Full name: System.Threading.Tasks.Parallel
val s : seq<'a>
Multiple items
val seq : sequence:seq<'T> -> seq<'T>
Full name: Microsoft.FSharp.Core.Operators.seq
--------------------
type seq<'T> = Collections.Generic.IEnumerable<'T>
Full name: Microsoft.FSharp.Collections.seq<_>
module Seq
from Microsoft.FSharp.Collections
val map : mapping:('T -> 'U) -> source:seq<'T> -> seq<'U>
Full name: Microsoft.FSharp.Collections.Seq.map
val x : 'a
Multiple items
module List
from Microsoft.FSharp.Collections
--------------------
type List<'T> =
| ( [] )
| ( :: ) of Head: 'T * Tail: 'T list
interface IEnumerable
interface IEnumerable<'T>
member Head : 'T
member IsEmpty : bool
member Item : index:int -> 'T with get
member Length : int
member Tail : 'T list
static member Cons : head:'T * tail:'T list -> 'T list
static member Empty : 'T list
Full name: Microsoft.FSharp.Collections.List<_>
val ofSeq : source:seq<'T> -> 'T list
Full name: Microsoft.FSharp.Collections.List.ofSeq
val ofList : source:'T list -> seq<'T>
Full name: Microsoft.FSharp.Collections.Seq.ofList
Multiple items
type AutoOpenAttribute =
inherit Attribute
new : unit -> AutoOpenAttribute
new : path:string -> AutoOpenAttribute
member Path : string
Full name: Microsoft.FSharp.Core.AutoOpenAttribute
--------------------
new : unit -> AutoOpenAttribute
new : path:string -> AutoOpenAttribute
Multiple items
type CompilationRepresentationAttribute =
inherit Attribute
new : flags:CompilationRepresentationFlags -> CompilationRepresentationAttribute
member Flags : CompilationRepresentationFlags
Full name: Microsoft.FSharp.Core.CompilationRepresentationAttribute
--------------------
new : flags:CompilationRepresentationFlags -> CompilationRepresentationAttribute
type CompilationRepresentationFlags =
| None = 0
| Static = 1
| Instance = 2
| ModuleSuffix = 4
| UseNullAsTrueValue = 8
| Event = 16
Full name: Microsoft.FSharp.Core.CompilationRepresentationFlags
CompilationRepresentationFlags.ModuleSuffix: CompilationRepresentationFlags = 4
val sync : Sync
Full name: YourNamespaceHere.SyncModule.sync
The Sync builder instance.
Used like: sync { return 0 }
Multiple items
type Vsync =
new : unit -> Vsync
member Bind : m:Async<'p> * f:('p -> Async<'q>) -> Async<'q>
member Combine : a:Async<unit> * b:Async<'m> -> Async<'m>
member Delay : f:(unit -> Async<'l>) -> Async<'l>
member For : m:seq<'k> * f:('k -> Async<unit>) -> Async<unit>
member Return : x:'o -> Async<'o>
member ReturnFrom : m:Async<'n> -> Async<'n>
member TryFinally : b:Async<'i> * c:(unit -> unit) -> Async<'i>
member TryWith : b:Async<'j> * h:(exn -> Async<'j>) -> Async<'j>
member Using : d:'g * b:('g -> Async<'h>) -> Async<'h> (requires 'g :> IDisposable)
...
Full name: YourNamespaceHere.Vsync
The 'Vsync' (AKA, 'Variable Synchronization') cexpr that coheres into the Sync cexpr when SYNC is #defined, and
into the Async cexpr otherwise.
TODO: forward documentation from FSharp.Core and Marvel.
--------------------
new : unit -> Vsync
val this : Vsync
member Vsync.Builder : AsyncBuilder
Full name: YourNamespaceHere.Vsync.Builder
val async : AsyncBuilder
Full name: Microsoft.FSharp.Core.ExtraTopLevelOperators.async
member Vsync.Bind : m:Async<'p> * f:('p -> Async<'q>) -> Async<'q>
Full name: YourNamespaceHere.Vsync.Bind
val m : Async<'p>
val f : ('p -> Async<'q>)
property Vsync.Builder: AsyncBuilder
member AsyncBuilder.Bind : computation:Async<'T> * binder:('T -> Async<'U>) -> Async<'U>
member Vsync.Return : x:'o -> Async<'o>
Full name: YourNamespaceHere.Vsync.Return
member AsyncBuilder.Return : value:'T -> Async<'T>
member Vsync.ReturnFrom : m:Async<'n> -> Async<'n>
Full name: YourNamespaceHere.Vsync.ReturnFrom
val m : Async<'n>
member AsyncBuilder.ReturnFrom : computation:Async<'T> -> Async<'T>
member Vsync.Zero : unit -> Async<unit>
Full name: YourNamespaceHere.Vsync.Zero
member AsyncBuilder.Zero : unit -> Async<unit>
member Vsync.Combine : a:Async<unit> * b:Async<'m> -> Async<'m>
Full name: YourNamespaceHere.Vsync.Combine
val a : Async<unit>
val b : Async<'m>
member AsyncBuilder.Combine : computation1:Async<unit> * computation2:Async<'T> -> Async<'T>
member Vsync.Delay : f:(unit -> Async<'l>) -> Async<'l>
Full name: YourNamespaceHere.Vsync.Delay
val f : (unit -> Async<'l>)
member AsyncBuilder.Delay : generator:(unit -> Async<'T>) -> Async<'T>
member Vsync.For : m:seq<'k> * f:('k -> Async<unit>) -> Async<unit>
Full name: YourNamespaceHere.Vsync.For
val m : seq<'k>
val f : ('k -> Async<unit>)
member AsyncBuilder.For : sequence:seq<'T> * body:('T -> Async<unit>) -> Async<unit>
member Vsync.While : g:(unit -> bool) * b:Async<unit> -> Async<unit>
Full name: YourNamespaceHere.Vsync.While
val b : Async<unit>
member AsyncBuilder.While : guard:(unit -> bool) * computation:Async<unit> -> Async<unit>
member Vsync.TryWith : b:Async<'j> * h:(exn -> Async<'j>) -> Async<'j>
Full name: YourNamespaceHere.Vsync.TryWith
val b : Async<'j>
val h : (exn -> Async<'j>)
member AsyncBuilder.TryWith : computation:Async<'T> * catchHandler:(exn -> Async<'T>) -> Async<'T>
member Vsync.TryFinally : b:Async<'i> * c:(unit -> unit) -> Async<'i>
Full name: YourNamespaceHere.Vsync.TryFinally
val b : Async<'i>
member AsyncBuilder.TryFinally : computation:Async<'T> * compensation:(unit -> unit) -> Async<'T>
member Vsync.Using : d:'g * b:('g -> Async<'h>) -> Async<'h> (requires 'g :> IDisposable)
Full name: YourNamespaceHere.Vsync.Using
val b : (#IDisposable -> Async<'h>)
member AsyncBuilder.Using : resource:'T * binder:('T -> Async<'U>) -> Async<'U> (requires 'T :> IDisposable)
static member Vsync.Ignore : m:Async<'f> -> Async<unit>
Full name: YourNamespaceHere.Vsync.Ignore
val m : Async<'f>
Multiple items
type Async
static member AsBeginEnd : computation:('Arg -> Async<'T>) -> ('Arg * AsyncCallback * obj -> IAsyncResult) * (IAsyncResult -> 'T) * (IAsyncResult -> unit)
static member AwaitEvent : event:IEvent<'Del,'T> * ?cancelAction:(unit -> unit) -> Async<'T> (requires delegate and 'Del :> Delegate)
static member AwaitIAsyncResult : iar:IAsyncResult * ?millisecondsTimeout:int -> Async<bool>
static member AwaitTask : task:Task<'T> -> Async<'T>
static member AwaitWaitHandle : waitHandle:WaitHandle * ?millisecondsTimeout:int -> Async<bool>
static member CancelDefaultToken : unit -> unit
static member Catch : computation:Async<'T> -> Async<Choice<'T,exn>>
static member FromBeginEnd : beginAction:(AsyncCallback * obj -> IAsyncResult) * endAction:(IAsyncResult -> 'T) * ?cancelAction:(unit -> unit) -> Async<'T>
static member FromBeginEnd : arg:'Arg1 * beginAction:('Arg1 * AsyncCallback * obj -> IAsyncResult) * endAction:(IAsyncResult -> 'T) * ?cancelAction:(unit -> unit) -> Async<'T>
static member FromBeginEnd : arg1:'Arg1 * arg2:'Arg2 * beginAction:('Arg1 * 'Arg2 * AsyncCallback * obj -> IAsyncResult) * endAction:(IAsyncResult -> 'T) * ?cancelAction:(unit -> unit) -> Async<'T>
static member FromBeginEnd : arg1:'Arg1 * arg2:'Arg2 * arg3:'Arg3 * beginAction:('Arg1 * 'Arg2 * 'Arg3 * AsyncCallback * obj -> IAsyncResult) * endAction:(IAsyncResult -> 'T) * ?cancelAction:(unit -> unit) -> Async<'T>
static member FromContinuations : callback:(('T -> unit) * (exn -> unit) * (OperationCanceledException -> unit) -> unit) -> Async<'T>
static member Ignore : computation:Async<'T> -> Async<unit>
static member OnCancel : interruption:(unit -> unit) -> Async<IDisposable>
static member Parallel : computations:seq<Async<'T>> -> Async<'T []>
static member RunSynchronously : computation:Async<'T> * ?timeout:int * ?cancellationToken:CancellationToken -> 'T
static member Sleep : millisecondsDueTime:int -> Async<unit>
static member Start : computation:Async<unit> * ?cancellationToken:CancellationToken -> unit
static member StartAsTask : computation:Async<'T> * ?taskCreationOptions:TaskCreationOptions * ?cancellationToken:CancellationToken -> Task<'T>
static member StartChild : computation:Async<'T> * ?millisecondsTimeout:int -> Async<Async<'T>>
static member StartChildAsTask : computation:Async<'T> * ?taskCreationOptions:TaskCreationOptions -> Async<Task<'T>>
static member StartImmediate : computation:Async<unit> * ?cancellationToken:CancellationToken -> unit
static member StartWithContinuations : computation:Async<'T> * continuation:('T -> unit) * exceptionContinuation:(exn -> unit) * cancellationContinuation:(OperationCanceledException -> unit) * ?cancellationToken:CancellationToken -> unit
static member SwitchToContext : syncContext:SynchronizationContext -> Async<unit>
static member SwitchToNewThread : unit -> Async<unit>
static member SwitchToThreadPool : unit -> Async<unit>
static member TryCancelled : computation:Async<'T> * compensation:(OperationCanceledException -> unit) -> Async<'T>
static member CancellationToken : Async<CancellationToken>
static member DefaultCancellationToken : CancellationToken
Full name: Microsoft.FSharp.Control.Async
--------------------
type Async<'T>
Full name: Microsoft.FSharp.Control.Async<_>
static member Async.Ignore : computation:Async<'T> -> Async<unit>
static member Vsync.Sleep : t:int -> Async<unit>
Full name: YourNamespaceHere.Vsync.Sleep
static member Async.Sleep : millisecondsDueTime:int -> Async<unit>
static member Vsync.RunSynchronously : m:Async<'e> -> 'e
Full name: YourNamespaceHere.Vsync.RunSynchronously
val m : Async<'e>
static member Async.RunSynchronously : computation:Async<'T> * ?timeout:int * ?cancellationToken:CancellationToken -> 'T
static member Vsync.StartAsTask : m:Async<'d> -> Task<'d>
Full name: YourNamespaceHere.Vsync.StartAsTask
val m : Async<'d>
static member Async.StartAsTask : computation:Async<'T> * ?taskCreationOptions:TaskCreationOptions * ?cancellationToken:CancellationToken -> Task<'T>
static member Vsync.AwaitTask : t:Task<'c> -> Async<'c>
Full name: YourNamespaceHere.Vsync.AwaitTask
val t : Task<'c>
static member Async.AwaitTask : task:Task<'T> -> Async<'T>
static member Vsync.Catch : m:Async<'b> -> Async<Choice<'b,exn>>
Full name: YourNamespaceHere.Vsync.Catch
Catch an exception while binding m.
NOTE: the semantics between a Sync.Catch and an Async.Catch are remarkably different. Most notably, Sync.Catch
is just the application of Choice1Of2 to m since there is no evaluation taking place inside of it.
val m : Async<'b>
static member Async.Catch : computation:Async<'T> -> Async<Choice<'T,exn>>
Multiple items
static member Vsync.Parallel : s:seq<Async<'a>> -> Async<'a []>
Full name: YourNamespaceHere.Vsync.Parallel
--------------------
type Parallel =
static member For : fromInclusive:int * toExclusive:int * body:Action<int> -> ParallelLoopResult + 11 overloads
static member ForEach<'TSource> : source:IEnumerable<'TSource> * body:Action<'TSource> -> ParallelLoopResult + 19 overloads
static member Invoke : [<ParamArray>] actions:Action[] -> unit + 1 overload
Full name: System.Threading.Tasks.Parallel
val s : seq<Async<'a>>
static member Async.Parallel : computations:seq<Async<'T>> -> Async<'T []>
val vsync : Vsync
Full name: YourNamespaceHere.VsyncModule.vsync
The Vsync builder instance.
Used like: vsync { return 0 }
Multiple items
module Vsync
from YourNamespaceHere
--------------------
type Vsync =
new : unit -> Vsync
member Bind : m:Async<'p> * f:('p -> Async<'q>) -> Async<'q>
member Combine : a:Async<unit> * b:Async<'m> -> Async<'m>
member Delay : f:(unit -> Async<'l>) -> Async<'l>
member For : m:seq<'k> * f:('k -> Async<unit>) -> Async<unit>
member Return : x:'o -> Async<'o>
member ReturnFrom : m:Async<'n> -> Async<'n>
member TryFinally : b:Async<'i> * c:(unit -> unit) -> Async<'i>
member TryWith : b:Async<'j> * h:(exn -> Async<'j>) -> Async<'j>
member Using : d:'g * b:('g -> Async<'h>) -> Async<'h> (requires 'g :> IDisposable)
...
Full name: YourNamespaceHere.Vsync
The 'Vsync' (AKA, 'Variable Synchronization') cexpr that coheres into the Sync cexpr when SYNC is #defined, and
into the Async cexpr otherwise.
TODO: forward documentation from FSharp.Core and Marvel.
--------------------
type Vsync<'a> = Async<'a>
Full name: YourNamespaceHere.Vsync<_>
The Vsync alias.
--------------------
new : unit -> Vsync
More information