Header menu logo F# Compiler Guide

FSharpExprPatterns Module

A collection of active patterns to analyze expressions

Active patterns

Active pattern Description

(|AddressOf|_|) arg1

Full Usage: (|AddressOf|_|) arg1

Parameters:
Returns: FSharpExpr option

Matches expressions which take the address of a location

arg0 : FSharpExpr
Returns: FSharpExpr option

(|AddressSet|_|) arg1

Full Usage: (|AddressSet|_|) arg1

Parameters:
Returns: (FSharpExpr * FSharpExpr) option

Matches expressions which set the contents of an address

arg0 : FSharpExpr
Returns: (FSharpExpr * FSharpExpr) option

(|AnonRecordGet|_|) arg1

Full Usage: (|AnonRecordGet|_|) arg1

Parameters:
Returns: (FSharpExpr * FSharpType * int) option

Matches expressions getting a field from an anonymous record. The integer represents the index into the sorted fields of the anonymous record.

arg0 : FSharpExpr
Returns: (FSharpExpr * FSharpType * int) option

(|Application|_|) arg1

Full Usage: (|Application|_|) arg1

Parameters:
Returns: (FSharpExpr * FSharpType list * FSharpExpr list) option

Matches expressions which are the application of function values

arg0 : FSharpExpr
Returns: (FSharpExpr * FSharpType list * FSharpExpr list) option

(|BaseValue|_|) arg1

Full Usage: (|BaseValue|_|) arg1

Parameters:
Returns: FSharpType option

Matches expressions which are uses of the 'base' value

arg0 : FSharpExpr
Returns: FSharpType option

(|CallWithWitnesses|_|) arg1

Full Usage: (|CallWithWitnesses|_|) arg1

Parameters:
Returns: (FSharpExpr option * FSharpMemberOrFunctionOrValue * FSharpType list * FSharpType list * FSharpExpr list * FSharpExpr list) option

Like Call but also indicates witness arguments

arg0 : FSharpExpr
Returns: (FSharpExpr option * FSharpMemberOrFunctionOrValue * FSharpType list * FSharpType list * FSharpExpr list * FSharpExpr list) option

(|Call|_|) arg1

Full Usage: (|Call|_|) arg1

Parameters:
Returns: (FSharpExpr option * FSharpMemberOrFunctionOrValue * FSharpType list * FSharpType list * FSharpExpr list) option

Matches expressions which are calls to members or module-defined functions. When calling curried functions and members the arguments are collapsed to a single collection of arguments, as done in the compiled version of these.

arg0 : FSharpExpr
Returns: (FSharpExpr option * FSharpMemberOrFunctionOrValue * FSharpType list * FSharpType list * FSharpExpr list) option

(|Coerce|_|) arg1

Full Usage: (|Coerce|_|) arg1

Parameters:
Returns: (FSharpType * FSharpExpr) option

Matches expressions which coerce the type of a value

arg0 : FSharpExpr
Returns: (FSharpType * FSharpExpr) option

(|Const|_|) arg1

Full Usage: (|Const|_|) arg1

Parameters:
Returns: (obj * FSharpType) option

Matches constant expressions, including signed and unsigned integers, strings, characters, booleans, arrays of bytes and arrays of unit16.

arg0 : FSharpExpr
Returns: (obj * FSharpType) option

(|DebugPoint|_|) arg1

Full Usage: (|DebugPoint|_|) arg1

Parameters:
Returns: (DebugPointAtLeafExpr * FSharpExpr) option

Matches debug points at leaf expressions in control flow

arg0 : FSharpExpr
Returns: (DebugPointAtLeafExpr * FSharpExpr) option

(|DecisionTreeSuccess|_|) arg1

Full Usage: (|DecisionTreeSuccess|_|) arg1

Parameters:
Returns: (int * FSharpExpr list) option

Special expressions at the end of a conditional decision structure in the decision expression node of a DecisionTree . The given expressions are passed as values to the decision tree target.

arg0 : FSharpExpr
Returns: (int * FSharpExpr list) option

(|DecisionTree|_|) arg1

Full Usage: (|DecisionTree|_|) arg1

Parameters:
Returns: (FSharpExpr * (FSharpMemberOrFunctionOrValue list * FSharpExpr) list) option

Matches expressions with a decision expression, each branch of which ends in DecisionTreeSuccess passing control and values to one of the targets.

arg0 : FSharpExpr
Returns: (FSharpExpr * (FSharpMemberOrFunctionOrValue list * FSharpExpr) list) option

(|DefaultValue|_|) arg1

Full Usage: (|DefaultValue|_|) arg1

Parameters:
Returns: FSharpType option

Matches default-value expressions, including null expressions

arg0 : FSharpExpr
Returns: FSharpType option

(|FSharpFieldGet|_|) arg1

Full Usage: (|FSharpFieldGet|_|) arg1

Parameters:
Returns: (FSharpExpr option * FSharpType * FSharpField) option

Matches expressions which get a field from a record or class

arg0 : FSharpExpr
Returns: (FSharpExpr option * FSharpType * FSharpField) option

(|FSharpFieldSet|_|) arg1

Full Usage: (|FSharpFieldSet|_|) arg1

Parameters:
Returns: (FSharpExpr option * FSharpType * FSharpField * FSharpExpr) option

Matches expressions which set a field in a record or class

arg0 : FSharpExpr
Returns: (FSharpExpr option * FSharpType * FSharpField * FSharpExpr) option

(|FastIntegerForLoop|_|) arg1

Full Usage: (|FastIntegerForLoop|_|) arg1

Parameters:
Returns: (FSharpExpr * FSharpExpr * FSharpExpr * bool * DebugPointAtFor * DebugPointAtInOrTo) option

Matches fast-integer loops (up or down)

arg0 : FSharpExpr
Returns: (FSharpExpr * FSharpExpr * FSharpExpr * bool * DebugPointAtFor * DebugPointAtInOrTo) option

(|ILAsm|_|) arg1

Full Usage: (|ILAsm|_|) arg1

Parameters:
Returns: (string * FSharpType list * FSharpExpr list) option

Matches expressions which are IL assembly code

arg0 : FSharpExpr
Returns: (string * FSharpType list * FSharpExpr list) option

(|ILFieldGet|_|) arg1

Full Usage: (|ILFieldGet|_|) arg1

Parameters:
Returns: (FSharpExpr option * FSharpType * string) option

Matches expressions which fetch a field from a .NET type

arg0 : FSharpExpr
Returns: (FSharpExpr option * FSharpType * string) option

(|ILFieldSet|_|) arg1

Full Usage: (|ILFieldSet|_|) arg1

Parameters:
Returns: (FSharpExpr option * FSharpType * string * FSharpExpr) option

Matches expressions which set a field in a .NET type

arg0 : FSharpExpr
Returns: (FSharpExpr option * FSharpType * string * FSharpExpr) option

(|IfThenElse|_|) arg1

Full Usage: (|IfThenElse|_|) arg1

Parameters:
Returns: (FSharpExpr * FSharpExpr * FSharpExpr) option

Matches expressions which are conditionals

arg0 : FSharpExpr
Returns: (FSharpExpr * FSharpExpr * FSharpExpr) option

(|Lambda|_|) arg1

Full Usage: (|Lambda|_|) arg1

Parameters:
Returns: (FSharpMemberOrFunctionOrValue * FSharpExpr) option

Matches expressions which are lambda abstractions

arg0 : FSharpExpr
Returns: (FSharpMemberOrFunctionOrValue * FSharpExpr) option

(|LetRec|_|) arg1

Full Usage: (|LetRec|_|) arg1

Parameters:
Returns: ((FSharpMemberOrFunctionOrValue * FSharpExpr * DebugPointAtBinding) list * FSharpExpr) option

Matches expressions which are let-rec definitions

arg0 : FSharpExpr
Returns: ((FSharpMemberOrFunctionOrValue * FSharpExpr * DebugPointAtBinding) list * FSharpExpr) option

(|Let|_|) arg1

Full Usage: (|Let|_|) arg1

Parameters:
Returns: ((FSharpMemberOrFunctionOrValue * FSharpExpr * DebugPointAtBinding) * FSharpExpr) option

Matches expressions which are let definitions

arg0 : FSharpExpr
Returns: ((FSharpMemberOrFunctionOrValue * FSharpExpr * DebugPointAtBinding) * FSharpExpr) option

(|NewAnonRecord|_|) arg1

Full Usage: (|NewAnonRecord|_|) arg1

Parameters:
Returns: (FSharpType * FSharpExpr list) option

Matches anonymous record expressions

arg0 : FSharpExpr
Returns: (FSharpType * FSharpExpr list) option

(|NewArray|_|) arg1

Full Usage: (|NewArray|_|) arg1

Parameters:
Returns: (FSharpType * FSharpExpr list) option

Matches array expressions

arg0 : FSharpExpr
Returns: (FSharpType * FSharpExpr list) option

(|NewDelegate|_|) arg1

Full Usage: (|NewDelegate|_|) arg1

Parameters:
Returns: (FSharpType * FSharpExpr) option

Matches expressions which create an instance of a delegate type

arg0 : FSharpExpr
Returns: (FSharpType * FSharpExpr) option

(|NewObject|_|) arg1

Full Usage: (|NewObject|_|) arg1

Parameters:
Returns: (FSharpMemberOrFunctionOrValue * FSharpType list * FSharpExpr list) option

Matches expressions which are calls to object constructors

arg0 : FSharpExpr
Returns: (FSharpMemberOrFunctionOrValue * FSharpType list * FSharpExpr list) option

(|NewRecord|_|) arg1

Full Usage: (|NewRecord|_|) arg1

Parameters:
Returns: (FSharpType * FSharpExpr list) option

Matches record expressions

arg0 : FSharpExpr
Returns: (FSharpType * FSharpExpr list) option

(|NewTuple|_|) arg1

Full Usage: (|NewTuple|_|) arg1

Parameters:
Returns: (FSharpType * FSharpExpr list) option

Matches tuple expressions

arg0 : FSharpExpr
Returns: (FSharpType * FSharpExpr list) option

(|NewUnionCase|_|) arg1

Full Usage: (|NewUnionCase|_|) arg1

Parameters:
Returns: (FSharpType * FSharpUnionCase * FSharpExpr list) option

Matches expressions which create an object corresponding to a union case

arg0 : FSharpExpr
Returns: (FSharpType * FSharpUnionCase * FSharpExpr list) option

(|ObjectExpr|_|) arg1

Full Usage: (|ObjectExpr|_|) arg1

Parameters:
Returns: (FSharpType * FSharpExpr * FSharpObjectExprOverride list * (FSharpType * FSharpObjectExprOverride list) list) option

Matches object expressions, returning the base type, the base call, the overrides and the interface implementations

arg0 : FSharpExpr
Returns: (FSharpType * FSharpExpr * FSharpObjectExprOverride list * (FSharpType * FSharpObjectExprOverride list) list) option

(|Quote|_|) arg1

Full Usage: (|Quote|_|) arg1

Parameters:
Returns: FSharpExpr option

Matches expressions which are quotation literals

arg0 : FSharpExpr
Returns: FSharpExpr option

(|Sequential|_|) arg1

Full Usage: (|Sequential|_|) arg1

Parameters:
Returns: (FSharpExpr * FSharpExpr) option

Matches sequential expressions

arg0 : FSharpExpr
Returns: (FSharpExpr * FSharpExpr) option

(|ThisValue|_|) arg1

Full Usage: (|ThisValue|_|) arg1

Parameters:
Returns: FSharpType option

Matches expressions which are uses of the 'this' value

arg0 : FSharpExpr
Returns: FSharpType option

(|TraitCall|_|) arg1

Full Usage: (|TraitCall|_|) arg1

Parameters:
Returns: (FSharpType list * string * SynMemberFlags * FSharpType list * FSharpType list * FSharpExpr list) option

Matches expressions for an unresolved call to a trait

arg0 : FSharpExpr
Returns: (FSharpType list * string * SynMemberFlags * FSharpType list * FSharpType list * FSharpExpr list) option

(|TryFinally|_|) arg1

Full Usage: (|TryFinally|_|) arg1

Parameters:
Returns: (FSharpExpr * FSharpExpr * DebugPointAtTry * DebugPointAtFinally) option

Matches try/finally expressions

arg0 : FSharpExpr
Returns: (FSharpExpr * FSharpExpr * DebugPointAtTry * DebugPointAtFinally) option

Matches try/with expressions

arg0 : FSharpExpr
Returns: (FSharpExpr * FSharpMemberOrFunctionOrValue * FSharpExpr * FSharpMemberOrFunctionOrValue * FSharpExpr * DebugPointAtTry * DebugPointAtWith) option

(|TupleGet|_|) arg1

Full Usage: (|TupleGet|_|) arg1

Parameters:
Returns: (FSharpType * int * FSharpExpr) option

Matches expressions which get a value from a tuple

arg0 : FSharpExpr
Returns: (FSharpType * int * FSharpExpr) option

(|TypeLambda|_|) arg1

Full Usage: (|TypeLambda|_|) arg1

Parameters:
Returns: (FSharpGenericParameter list * FSharpExpr) option

Matches expressions which are type abstractions

arg0 : FSharpExpr
Returns: (FSharpGenericParameter list * FSharpExpr) option

(|TypeTest|_|) arg1

Full Usage: (|TypeTest|_|) arg1

Parameters:
Returns: (FSharpType * FSharpExpr) option

Matches expressions which test the runtime type of a value

arg0 : FSharpExpr
Returns: (FSharpType * FSharpExpr) option

(|UnionCaseGet|_|) arg1

Full Usage: (|UnionCaseGet|_|) arg1

Parameters:
Returns: (FSharpExpr * FSharpType * FSharpUnionCase * FSharpField) option

Matches expressions which get a field from a union case

arg0 : FSharpExpr
Returns: (FSharpExpr * FSharpType * FSharpUnionCase * FSharpField) option

(|UnionCaseSet|_|) arg1

Full Usage: (|UnionCaseSet|_|) arg1

Parameters:
Returns: (FSharpExpr * FSharpType * FSharpUnionCase * FSharpField * FSharpExpr) option

Matches expressions which set a field from a union case (only used in FSharp.Core itself)

arg0 : FSharpExpr
Returns: (FSharpExpr * FSharpType * FSharpUnionCase * FSharpField * FSharpExpr) option

(|UnionCaseTag|_|) arg1

Full Usage: (|UnionCaseTag|_|) arg1

Parameters:
Returns: (FSharpExpr * FSharpType) option

Matches expressions which gets the tag for a union case

arg0 : FSharpExpr
Returns: (FSharpExpr * FSharpType) option

(|UnionCaseTest|_|) arg1

Full Usage: (|UnionCaseTest|_|) arg1

Parameters:
Returns: (FSharpExpr * FSharpType * FSharpUnionCase) option

Matches expressions which test if an expression corresponds to a particular union case

arg0 : FSharpExpr
Returns: (FSharpExpr * FSharpType * FSharpUnionCase) option

(|ValueSet|_|) arg1

Full Usage: (|ValueSet|_|) arg1

Parameters:
Returns: (FSharpMemberOrFunctionOrValue * FSharpExpr) option

Matches expressions which set the contents of a mutable variable

arg0 : FSharpExpr
Returns: (FSharpMemberOrFunctionOrValue * FSharpExpr) option

(|Value|_|) arg1

Full Usage: (|Value|_|) arg1

Parameters:
Returns: FSharpMemberOrFunctionOrValue option

Matches expressions which are uses of values

arg0 : FSharpExpr
Returns: FSharpMemberOrFunctionOrValue option

(|WhileLoop|_|) arg1

Full Usage: (|WhileLoop|_|) arg1

Parameters:
Returns: (FSharpExpr * FSharpExpr * DebugPointAtWhile) option

Matches while loops

arg0 : FSharpExpr
Returns: (FSharpExpr * FSharpExpr * DebugPointAtWhile) option

(|WitnessArg|_|) arg1

Full Usage: (|WitnessArg|_|) arg1

Parameters:
Returns: int option

Indicates a witness argument index from the witness arguments supplied to the enclosing method

arg0 : FSharpExpr
Returns: int option

Type something to start searching.