Var Type
Information at the binding site of a variable
Constructors
Constructor |
Description
|
|
Creates a new variable with the given name, type and mutability
Example
Multiple items
namespace Microsoft.FSharp -------------------- namespace FSharp namespace Microsoft.FSharp.Quotations
namespace Microsoft.FSharp
module Patterns
from Microsoft.FSharp.Quotations
val valueVar: 'a * System.Type
Multiple items
active recognizer Var: Expr -> Var option -------------------- type Var = interface IComparable new: name: string * typ: Type * ?isMutable: bool -> Var static member Global: name: string * typ: Type -> Var member IsMutable: bool member Name: string member Type: Type -------------------- new: name: string * typ: System.Type * ?isMutable: bool -> Var val typeof<'T> : System.Type
Multiple items
Evaluates to a new quotation variable with the given name and typeval int: value: 'T -> int (requires member op_Explicit) -------------------- type int = int32 -------------------- type int<'Measure> = int .
|
Instance members
Instance member |
Description
|
|
Indicates if the variable represents a mutable storage location
Example
Multiple items
namespace Microsoft.FSharp -------------------- namespace FSharp namespace Microsoft.FSharp.Quotations
namespace Microsoft.FSharp
module Patterns
from Microsoft.FSharp.Quotations
val v: obj
active recognizer Lambda: Expr -> (Var * Expr) option
val v: Var
val body: Expr
property Var.IsMutable: bool with get
val failwith: message: string -> 'T
Evaluates to false .
|
The declared name of the variable
Example
Multiple items
namespace Microsoft.FSharp -------------------- namespace FSharp namespace Microsoft.FSharp.Quotations
namespace Microsoft.FSharp
module Patterns
from Microsoft.FSharp.Quotations
val v: obj
active recognizer Lambda: Expr -> (Var * Expr) option
val v: Var
val body: Expr
property Var.Name: string with get
val failwith: message: string -> 'T
Evaluates to "v"
|
|
The type associated with the variable
Example
Multiple items
namespace Microsoft.FSharp -------------------- namespace FSharp namespace Microsoft.FSharp.Quotations
namespace Microsoft.FSharp
module Patterns
from Microsoft.FSharp.Quotations
val v: obj
active recognizer Lambda: Expr -> (Var * Expr) option
val v: Var
val body: Expr
property Var.Type: System.Type with get
val failwith: message: string -> 'T
Evaluates to typeof<int>
|
Static members
Static member |
Description
|
|
Fetches or create a new variable with the given name and type from a global pool of shared variables indexed by name and type
Example
Multiple items
namespace Microsoft.FSharp -------------------- namespace FSharp namespace Microsoft.FSharp.Quotations
namespace Microsoft.FSharp
module Patterns
from Microsoft.FSharp.Quotations
val valueVar1: Var
Multiple items
active recognizer Var: Expr -> Var option -------------------- type Var = interface IComparable new: name: string * typ: Type * ?isMutable: bool -> Var static member Global: name: string * typ: Type -> Var member IsMutable: bool member Name: string member Type: Type -------------------- new: name: string * typ: System.Type * ?isMutable: bool -> Var static member Var.Global: name: string * typ: System.Type -> Var
val typeof<'T> : System.Type
Multiple items
val int: value: 'T -> int (requires member op_Explicit) -------------------- type int = int32 -------------------- type int<'Measure> = int val valueVar2: Var
Evaluates both to valueVar1 and valueVar2 to the same variable from a global pool of shared variables.
|