FSharp.Core


StateMachineHelpers Module

Contains compiler intrinsics related to the definition of state machines.

Functions and values

Function or value Description

__debugPoint arg1

Full Usage: __debugPoint arg1

Parameters:

Indicates a named debug point arising from the context of inlined code.

Only a limited range of debug point names are supported. If the debug point name is the empty string then the range used for the debug point will be the range of the outermost expression prior to inlining. If the debug point name is ForLoop.InOrToKeyword and the code was ultimately from a for .. in .. do or for .. = .. to .. do construct in a computation expression, de-sugared to an inlined builder.For call, then the name "ForLoop.InOrToKeyword" can be used. The range of the debug point will be precisely the range of the in or to keyword. If the name doesn't correspond to a known debug point arising from the original source context, then an opt-in warning 3514 is emitted, and the range used for the debug point will be the range of the root expression prior to inlining.

arg0 : string

__resumableEntry ()

Full Usage: __resumableEntry ()

Parameters:
Returns: int option

Indicates a resumption point within resumable code

() : unit
Returns: int option

__resumeAt programLabel

Full Usage: __resumeAt programLabel

Parameters:
    programLabel : int -

Returns: 'T

Indicates to jump to a resumption point within resumable code. This may be the first statement in a MoveNextMethodImpl. The integer must be a valid resumption point within this resumable code.

programLabel : int

Returns: 'T

__stateMachine moveNextMethod setStateMachineMethod afterCode

Full Usage: __stateMachine moveNextMethod setStateMachineMethod afterCode

Parameters:
    moveNextMethod : MoveNextMethodImpl<'Data> - Gives the implementation of the MoveNext method on IAsyncStateMachine.
    setStateMachineMethod : SetStateMachineMethodImpl<'Data> - Gives the implementation of the SetStateMachine method on IAsyncStateMachine.
    afterCode : AfterCode<'Data, 'Result> - Gives code to execute after the generation of the state machine and to produce the final result.

Returns: 'Result

Statically generates a closure struct type based on ResumableStateMachine, At runtime an instance of the new struct type is populated and 'afterMethod' is called to consume it.

At compile-time, the ResumableStateMachine type guides the generation of a new struct type by the F# compiler with closure-capture fields in a way similar to an object expression. Any mention of the ResumableStateMachine type in any the 'methods' is rewritten to this fresh struct type. The 'methods' are used to implement the interfaces on ResumableStateMachine and are also rewritten. The 'after' method is then executed and must eliminate the ResumableStateMachine. For example, its return type must not include ResumableStateMachine.

moveNextMethod : MoveNextMethodImpl<'Data>

Gives the implementation of the MoveNext method on IAsyncStateMachine.

setStateMachineMethod : SetStateMachineMethodImpl<'Data>

Gives the implementation of the SetStateMachine method on IAsyncStateMachine.

afterCode : AfterCode<'Data, 'Result>

Gives code to execute after the generation of the state machine and to produce the final result.

Returns: 'Result

__useResumableCode

Full Usage: __useResumableCode

Returns: bool

When used in a conditional, statically determines whether the 'then' branch represents valid resumable code and provides an alternative implementation if not.

Returns: bool