Quotations.Expr Class (F#)

Quoted expressions annotated with Type values.

Namespace/Module Path: Microsoft.FSharp.Quotations

Assembly: FSharp.Core (in FSharp.Core.dll)

type Expr =
 class
  static member AddressOf : Expr -> Expr
  static member AddressSet : Expr * Expr -> Expr
  static member Application : Expr * Expr -> Expr
  static member Applications : Expr * Expr list list -> Expr
  static member Call : Expr * MethodInfo * Expr list -> Expr
  static member Call : MethodInfo * Expr list -> Expr
  static member Cast : Expr -> Expr<'T>
  static member Coerce : Expr * Type -> Expr
  static member DefaultValue : Type -> Expr
  static member Deserialize : Type * Type list * Expr list * byte [] -> Expr
  static member FieldGet : Expr * FieldInfo -> Expr
  static member FieldGet : FieldInfo -> Expr
  static member FieldSet : Expr * FieldInfo * Expr -> Expr
  static member FieldSet : FieldInfo * Expr -> Expr
  static member ForIntegerRangeLoop : Var * Expr * Expr * Expr -> Expr
  member this.GetFreeVars : unit -> seq<Var>
  static member GlobalVar : string -> Expr<'T>
  static member IfThenElse : Expr * Expr * Expr -> Expr
  static member Lambda : Var * Expr -> Expr
  static member Let : Var * Expr * Expr -> Expr
  static member LetRecursive : Var * Expr list * Expr -> Expr
  static member NewArray : Type * Expr list -> Expr
  static member NewDelegate : Type * Var list * Expr -> Expr
  static member NewObject : ConstructorInfo * Expr list -> Expr
  static member NewRecord : Type * Expr list -> Expr
  static member NewTuple : Expr list -> Expr
  static member NewUnionCase : UnionCaseInfo * Expr list -> Expr
  static member PropertyGet : PropertyInfo * Expr list option -> Expr
  static member PropertyGet : Expr * PropertyInfo * Expr list option -> Expr
  static member PropertySet : PropertyInfo * Expr * Expr list option -> Expr
  static member PropertySet : Expr * PropertyInfo * Expr * Expr list option -> Expr
  static member Quote : Expr -> Expr
  static member RegisterReflectedDefinitions : Assembly * string * byte [] -> unit
  static member Sequential : Expr * Expr -> Expr
  member this.Substitute : (Var -> Expr option) -> Expr
  member this.ToString : bool -> string
  static member TryFinally : Expr * Expr -> Expr
  static member TryGetReflectedDefinition : MethodBase -> Expr option
  static member TryWith : Expr * Var * Expr * Var * Expr -> Expr
  static member TupleGet : Expr * int -> Expr
  static member TypeTest : Expr * Type -> Expr
  static member UnionCaseTest : Expr * UnionCaseInfo -> Expr
  static member Value : 'T -> Expr
  static member Value : obj * Type -> Expr
  static member Var : Var -> Expr
  static member VarSet : Var * Expr -> Expr
  static member WhileLoop : Expr * Expr -> Expr
  member this.CustomAttributes :  Expr list
  member this.Type :  Type
 end

Remarks

This type is named FSharpExpr in compiled assemblies. If you are accessing the type from a language other than F#, or through reflection, use this name.

Instance Members

Member

Description

CustomAttributes

Returns the custom attributes of an expression.

GetFreeVars

Gets the free expression variables of an expression as a list.

Substitute

Substitutes through the given expression using the given functions to map variables to new values. The functions must give consistent results at each application. Variable renaming may occur on the target expression if variable capture occurs.

ToString

Formats the expression as a string.

Type

Returns type of an expression.

Static Members

Member

Description

AddressOf

Creates an expression that represents getting the address of a value.

AddressSet

Creates an expression that represents setting the value held at a particular address.

Application

Creates an expression that represents the application of a first class function value to a single argument.

Applications

Creates an expression that represents the application of a first class function value to multiple arguments.

Call

Creates an expression that represents a call to an instance method associated with an object.

Cast

Returns a new typed expression given an underlying runtime-typed expression. A type annotation is usually required to use this function, and using an incorrect type annotation may result in a later runtime exception.

Coerce

Creates an expression that represents the coercion of an expression to a type

DefaultValue

Creates an expression that represents the invocation of a default object constructor

Deserialize

This function is called automatically when quotation syntax (<@ @>) and related typed-expression quotations are used. The bytes are a pickled binary representation of an unlinked form of the quoted expression, and the Type argument is any type in the assembly where the quoted expression occurs, that is, it helps scope the interpretation of the cross-assembly references in the bytes.

FieldGet

Creates an expression that represents the access of a field of an object.

FieldSet

Creates an expression that represents writing to a field of an object.

ForIntegerRangeLoop

Creates a for expression that represent loops over integer ranges.

GlobalVar

Fetches or creates a new variable with the given name and type from a global pool of shared variables indexed by name and type. The type is given by the explicit or inferred type parameter.

IfThenElse

Creates an if...then...else expression.

Lambda

Creates an expression that represents the construction of an F# function value.

Let

Creates expressions associated with let constructs.

LetRecursive

Creates recursive expressions associated with let rec constructs.

NewArray

Creates an expression that represents the creation of an array value initialized with the given elements.

NewDelegate

Creates an expression that represents the creation of a delegate value for the given type.

NewObject

Creates an expression that represents the invocation of an object constructor.

NewRecord

Creates record-construction expressions.

NewTuple

Creates an expression that represents the creation of an F# tuple value.

NewUnionCase

Creates an expression that represents the creation of a union case value.

PropertyGet

Creates an expression that represents reading a static property.

PropertySet

Creates an expression that represents writing to a static property.

Quote

Creates an expression that represents a nested quotation literal.

RegisterReflectedDefinitions

Permits interactive environments such as F# Interactive to explicitly register new pickled resources that represent persisted top level definitions. The string indicates a unique name for the resources being added. The format for the bytes is the encoding generated by the F# compiler.

Sequential

Creates an expression that represents the sequential execution of one expression followed by another.

TryFinally

Creates an expression that represents a try...finally construct.

TryGetReflectedDefinition

Try and find a stored reflection definition for the given method. Stored reflection definitions are added to an F# assembly through the use of the ReflectedDefinition attribute.

TryWith

Creates an expression that represents a try...with construct for exception filtering and catching.

TupleGet

Creates an expression that represents getting a field of a tuple.

TypeTest

Creates an expression that represents a type test.

UnionCaseTest

Creates an expression that represents a test of a value is of a particular union case.

Value

Creates an expression that represents a constant value.

Value

Creates an expression that represents a constant value of a particular type.

Var

Creates an expression that represents a variable.

VarSet

Creates an expression that represents setting a mutable variable.

WhileLoop

Creates an expression that represents a while loop.

Platforms

Windows 8, Windows 7, Windows Server 2012, Windows Server 2008 R2

Version Information

F# Core Library Versions

Supported in: 2.0, 4.0, Portable

See Also

Reference

Microsoft.FSharp.Quotations Namespace (F#)