Header menu logo FSharp.Core

DerivedPatterns Module

Contains a set of derived F# active patterns to analyze F# expression objects

Active patterns

Active pattern Description

(|AndAlso|_|) input

Full Usage: (|AndAlso|_|) input

Parameters:
    input : Expr - The input expression to match against.

Returns: (Expr * Expr) option When successful, the pattern binds the left and right parts of the input expression

An active pattern to recognize expressions of the form a && b

input : Expr

The input expression to match against.

Returns: (Expr * Expr) option

When successful, the pattern binds the left and right parts of the input expression

Example

 open FSharp.Quotations.DerivedPatterns

 match <@ true && false @> with
 | AndAlso (a, b) -> (a, b)
 | _ -> failwith "unexpected"
Multiple items
namespace Microsoft.FSharp

--------------------
namespace FSharp
namespace Microsoft.FSharp.Quotations
module DerivedPatterns from Microsoft.FSharp.Quotations
active recognizer AndAlso: Quotations.Expr -> (Quotations.Expr * Quotations.Expr) option
val a: Quotations.Expr
val b: Quotations.Expr
val failwith: message: string -> 'T
Evaluates to <@ true @>, <@ false @>.

(|Applications|_|) input

Full Usage: (|Applications|_|) input

Parameters:
    input : Expr - The input expression to match against.

Returns: (Expr * Expr list list) option When successful, the pattern binds the function and curried arguments of the input expression

An active pattern to recognize expressions that represent the application of a (possibly curried or tupled) first class function value

input : Expr

The input expression to match against.

Returns: (Expr * Expr list list) option

When successful, the pattern binds the function and curried arguments of the input expression

Example

 open FSharp.Quotations.Patterns
 open FSharp.Quotations.DerivedPatterns

 match <@ (fun f -> f (1, 2) 3) @> with
 | Lambda(_, Applications (f, curriedArgs)) ->
     curriedArgs |> List.map (fun args -> args.Length)
 | _ -> failwith "unexpected"
Multiple items
namespace Microsoft.FSharp

--------------------
namespace FSharp
namespace Microsoft.FSharp.Quotations
module Patterns from Microsoft.FSharp.Quotations
namespace Microsoft.FSharp
module DerivedPatterns from Microsoft.FSharp.Quotations
val f: (int * int -> int -> obj)
active recognizer Lambda: Quotations.Expr -> (Quotations.Var * Quotations.Expr) option
active recognizer Applications: Quotations.Expr -> (Quotations.Expr * Quotations.Expr list list) option
val f: Quotations.Expr
val curriedArgs: Quotations.Expr list list
Multiple items
module List from Microsoft.FSharp.Collections

--------------------
type List<'T> = | op_Nil | op_ColonColon of Head: 'T * Tail: 'T list interface IReadOnlyList<'T> interface IReadOnlyCollection<'T> interface IEnumerable interface IEnumerable<'T> member GetReverseIndex: rank: int * offset: int -> int member GetSlice: startIndex: int option * endIndex: int option -> 'T list static member Cons: head: 'T * tail: 'T list -> 'T list member Head: 'T member IsEmpty: bool member Item: index: int -> 'T with get ...
val map: mapping: ('T -> 'U) -> list: 'T list -> 'U list
val args: Quotations.Expr list
property List.Length: int with get
val failwith: message: string -> 'T
Evaluates to [2; 1].

(|Bool|_|) input

Full Usage: (|Bool|_|) input

Parameters:
    input : Expr - The input expression to match against.

Returns: bool option When successful, the pattern binds the constant value from the input expression

An active pattern to recognize constant boolean expressions

input : Expr

The input expression to match against.

Returns: bool option

When successful, the pattern binds the constant value from the input expression

Example

 open FSharp.Quotations.DerivedPatterns

 match <@ true @> with
 | Bool v -> v
 | _ -> failwith "unexpected"
Multiple items
namespace Microsoft.FSharp

--------------------
namespace FSharp
namespace Microsoft.FSharp.Quotations
module DerivedPatterns from Microsoft.FSharp.Quotations
active recognizer Bool: Quotations.Expr -> bool option
val v: bool
val failwith: message: string -> 'T
Evaluates to true.

(|Byte|_|) input

Full Usage: (|Byte|_|) input

Parameters:
    input : Expr - The input expression to match against.

Returns: byte option When successful, the pattern binds the constant value from the input expression

An active pattern to recognize constant byte expressions

input : Expr

The input expression to match against.

Returns: byte option

When successful, the pattern binds the constant value from the input expression

Example

 open FSharp.Quotations.DerivedPatterns

 match <@ 8uy @> with
 | Byte v -> v
 | _ -> failwith "unexpected"
Multiple items
namespace Microsoft.FSharp

--------------------
namespace FSharp
namespace Microsoft.FSharp.Quotations
module DerivedPatterns from Microsoft.FSharp.Quotations
active recognizer Byte: Quotations.Expr -> byte option
val v: byte
val failwith: message: string -> 'T
Evaluates to 8uy.

(|Char|_|) input

Full Usage: (|Char|_|) input

Parameters:
    input : Expr - The input expression to match against.

Returns: char option When successful, the pattern binds the constant value from the input expression

An active pattern to recognize constant unicode character expressions

input : Expr

The input expression to match against.

Returns: char option

When successful, the pattern binds the constant value from the input expression

Example

 open FSharp.Quotations.DerivedPatterns

 match <@ 'a' @> with
 | Char v -> v
 | _ -> failwith "unexpected"
Multiple items
namespace Microsoft.FSharp

--------------------
namespace FSharp
namespace Microsoft.FSharp.Quotations
module DerivedPatterns from Microsoft.FSharp.Quotations
active recognizer Char: Quotations.Expr -> char option
val v: char
val failwith: message: string -> 'T
Evaluates to 'a'.

(|Decimal|_|) input

Full Usage: (|Decimal|_|) input

Parameters:
    input : Expr - The input expression to match against.

Returns: decimal option When successful, the pattern binds the constant value from the input expression

An active pattern to recognize constant decimal expressions

input : Expr

The input expression to match against.

Returns: decimal option

When successful, the pattern binds the constant value from the input expression

Example

 open FSharp.Quotations.DerivedPatterns

 match <@ 8.0M @> with
 | Decimal v -> v
 | _ -> failwith "unexpected"
Multiple items
namespace Microsoft.FSharp

--------------------
namespace FSharp
namespace Microsoft.FSharp.Quotations
module DerivedPatterns from Microsoft.FSharp.Quotations
active recognizer Decimal: Quotations.Expr -> decimal option
val v: decimal
val failwith: message: string -> 'T
Evaluates to 8.0M.

(|Double|_|) input

Full Usage: (|Double|_|) input

Parameters:
    input : Expr - The input expression to match against.

Returns: float option When successful, the pattern binds the constant value from the input expression

An active pattern to recognize constant 64-bit floating point number expressions

input : Expr

The input expression to match against.

Returns: float option

When successful, the pattern binds the constant value from the input expression

Example

 open FSharp.Quotations.DerivedPatterns

 match <@ 1.0 @> with
 | Double v -> v
 | _ -> failwith "unexpected"
Multiple items
namespace Microsoft.FSharp

--------------------
namespace FSharp
namespace Microsoft.FSharp.Quotations
module DerivedPatterns from Microsoft.FSharp.Quotations
active recognizer Double: Quotations.Expr -> float option
val v: float
val failwith: message: string -> 'T
Evaluates to 1.0.

(|Int16|_|) input

Full Usage: (|Int16|_|) input

Parameters:
    input : Expr - The input expression to match against.

Returns: int16 option When successful, the pattern binds the constant value from the input expression

An active pattern to recognize constant int16 expressions

input : Expr

The input expression to match against.

Returns: int16 option

When successful, the pattern binds the constant value from the input expression

Example

 open FSharp.Quotations.DerivedPatterns

 match <@ 8s @> with
 | Int16 v -> v
 | _ -> failwith "unexpected"
Multiple items
namespace Microsoft.FSharp

--------------------
namespace FSharp
namespace Microsoft.FSharp.Quotations
module DerivedPatterns from Microsoft.FSharp.Quotations
active recognizer Int16: Quotations.Expr -> int16 option
val v: int16
val failwith: message: string -> 'T
Evaluates to 8s.

(|Int32|_|) input

Full Usage: (|Int32|_|) input

Parameters:
    input : Expr - The input expression to match against.

Returns: int32 option When successful, the pattern binds the constant value from the input expression

An active pattern to recognize constant int32 expressions

input : Expr

The input expression to match against.

Returns: int32 option

When successful, the pattern binds the constant value from the input expression

Example

 open FSharp.Quotations.DerivedPatterns

 match <@ 8 @> with
 | Int32 v -> v
 | _ -> failwith "unexpected"
Multiple items
namespace Microsoft.FSharp

--------------------
namespace FSharp
namespace Microsoft.FSharp.Quotations
module DerivedPatterns from Microsoft.FSharp.Quotations
active recognizer Int32: Quotations.Expr -> int32 option
val v: int32
val failwith: message: string -> 'T
Evaluates to 8.

(|Int64|_|) input

Full Usage: (|Int64|_|) input

Parameters:
    input : Expr - The input expression to match against.

Returns: int64 option When successful, the pattern binds the constant value from the input expression

An active pattern to recognize constant int64 expressions

input : Expr

The input expression to match against.

Returns: int64 option

When successful, the pattern binds the constant value from the input expression

Example

 open FSharp.Quotations.DerivedPatterns

 match <@ 8L @> with
 | Int64 v -> v
 | _ -> failwith "unexpected"
Multiple items
namespace Microsoft.FSharp

--------------------
namespace FSharp
namespace Microsoft.FSharp.Quotations
module DerivedPatterns from Microsoft.FSharp.Quotations
active recognizer Int64: Quotations.Expr -> int64 option
val v: int64
val failwith: message: string -> 'T
Evaluates to 8L.

(|Lambdas|_|) input

Full Usage: (|Lambdas|_|) input

Parameters:
    input : Expr - The input expression to match against.

Returns: (Var list list * Expr) option When successful, the pattern binds the curried variables and body of the input expression

An active pattern to recognize expressions that represent a (possibly curried or tupled) first class function value

input : Expr

The input expression to match against.

Returns: (Var list list * Expr) option

When successful, the pattern binds the curried variables and body of the input expression

Example

 open FSharp.Quotations.Patterns
 open FSharp.Quotations.DerivedPatterns

 match <@ (fun (a1, a2) b -> ()) @> with
 | Lambdas(curriedVars, _) ->
     curriedVars |> List.map (List.map (fun arg -> arg.Name))
 | _ -> failwith "unexpected"
Multiple items
namespace Microsoft.FSharp

--------------------
namespace FSharp
namespace Microsoft.FSharp.Quotations
module Patterns from Microsoft.FSharp.Quotations
namespace Microsoft.FSharp
module DerivedPatterns from Microsoft.FSharp.Quotations
val a1: obj
val a2: obj
val b: obj
active recognizer Lambdas: Quotations.Expr -> (Quotations.Var list list * Quotations.Expr) option
val curriedVars: Quotations.Var list list
Multiple items
module List from Microsoft.FSharp.Collections

--------------------
type List<'T> = | op_Nil | op_ColonColon of Head: 'T * Tail: 'T list interface IReadOnlyList<'T> interface IReadOnlyCollection<'T> interface IEnumerable interface IEnumerable<'T> member GetReverseIndex: rank: int * offset: int -> int member GetSlice: startIndex: int option * endIndex: int option -> 'T list static member Cons: head: 'T * tail: 'T list -> 'T list member Head: 'T member IsEmpty: bool member Item: index: int -> 'T with get ...
val map: mapping: ('T -> 'U) -> list: 'T list -> 'U list
val arg: Quotations.Var
property Quotations.Var.Name: string with get
val failwith: message: string -> 'T
Evaluates to [["a1"; "a2"]; ["b"]].

(|MethodWithReflectedDefinition|_|) methodBase

Full Usage: (|MethodWithReflectedDefinition|_|) methodBase

Parameters:
    methodBase : MethodBase - The description of the method.

Returns: Expr option The expression of the method definition if found, or None.

An active pattern to recognize methods that have an associated ReflectedDefinition

methodBase : MethodBase

The description of the method.

Returns: Expr option

The expression of the method definition if found, or None.

Example

 open FSharp.Quotations
 open FSharp.Quotations.Patterns
 open FSharp.Quotations.DerivedPatterns

 [<ReflectedDefinition>]
 let f x = (x, x)

 let inpExpr = <@ f 4 @>

 let implExpr =
     match inpExpr with
     | Call(None, MethodWithReflectedDefinition implExpr, [ _argExpr ]) -> implExpr
     | _ -> failwith "unexpected"
Multiple items
namespace Microsoft.FSharp

--------------------
namespace FSharp
namespace Microsoft.FSharp.Quotations
namespace Microsoft.FSharp
module Patterns from Microsoft.FSharp.Quotations
module DerivedPatterns from Microsoft.FSharp.Quotations
Multiple items
type ReflectedDefinitionAttribute = inherit Attribute new: unit -> ReflectedDefinitionAttribute + 1 overload member IncludeValue: bool

--------------------
new: unit -> ReflectedDefinitionAttribute
new: includeValue: bool -> ReflectedDefinitionAttribute
val f: x: 'a -> 'a * 'a
val x: 'a
val inpExpr: Expr<int * int>
val implExpr: Expr
active recognizer Call: Expr -> (Expr option * System.Reflection.MethodInfo * Expr list) option
union case Option.None: Option<'T>
active recognizer MethodWithReflectedDefinition: System.Reflection.MethodBase -> Expr option
val _argExpr: Expr
val failwith: message: string -> 'T
Evaluates implExpr to a quotation with the same structure as <@ fun (x: int) -> (x, x) @>, which is the implementation of the method f. Note that the correct generic instantiation has been applied to the implementation to reflect the type at the callsite.

(|OrElse|_|) input

Full Usage: (|OrElse|_|) input

Parameters:
    input : Expr - The input expression to match against.

Returns: (Expr * Expr) option When successful, the pattern binds the left and right parts of the input expression

An active pattern to recognize expressions of the form a || b

input : Expr

The input expression to match against.

Returns: (Expr * Expr) option

When successful, the pattern binds the left and right parts of the input expression

Example

 open FSharp.Quotations.DerivedPatterns

 match <@ true || false @> with
 | OrElse (a, b) -> (a, b)
 | _ -> failwith "unexpected"
Multiple items
namespace Microsoft.FSharp

--------------------
namespace FSharp
namespace Microsoft.FSharp.Quotations
module DerivedPatterns from Microsoft.FSharp.Quotations
active recognizer OrElse: Quotations.Expr -> (Quotations.Expr * Quotations.Expr) option
val a: Quotations.Expr
val b: Quotations.Expr
val failwith: message: string -> 'T
Evaluates to <@ true @>, <@ false @>.

(|PropertyGetterWithReflectedDefinition|_|) propertyInfo

Full Usage: (|PropertyGetterWithReflectedDefinition|_|) propertyInfo

Parameters:
    propertyInfo : PropertyInfo - The description of the property.

Returns: Expr option The expression of the method definition if found, or None.

An active pattern to recognize property getters or values in modules that have an associated ReflectedDefinition

propertyInfo : PropertyInfo

The description of the property.

Returns: Expr option

The expression of the method definition if found, or None.

Example

 open FSharp.Quotations
 open FSharp.Quotations.Patterns
 open FSharp.Quotations.DerivedPatterns

 [<ReflectedDefinition>]
 type C<'T>() =
    member x.Identity = x

 let inpExpr = <@ C<int>().Identity @>

 let implExpr =
     match inpExpr with
     | PropertyGet(Some _, PropertyGetterWithReflectedDefinition implExpr, [ ]) -> implExpr
     | _ -> failwith "unexpected"
Multiple items
namespace Microsoft.FSharp

--------------------
namespace FSharp
namespace Microsoft.FSharp.Quotations
namespace Microsoft.FSharp
module Patterns from Microsoft.FSharp.Quotations
module DerivedPatterns from Microsoft.FSharp.Quotations
Multiple items
type ReflectedDefinitionAttribute = inherit Attribute new: unit -> ReflectedDefinitionAttribute + 1 overload member IncludeValue: bool

--------------------
new: unit -> ReflectedDefinitionAttribute
new: includeValue: bool -> ReflectedDefinitionAttribute
type C<'T> = new: unit -> C<'T> member Identity: C<'T>
'T
val x: C<'T>
val inpExpr: Expr<C<int>>
new: unit -> C<'T>
Multiple items
val int: value: 'T -> int (requires member op_Explicit)

--------------------
type int = int32

--------------------
type int<'Measure> = int
val implExpr: Expr
active recognizer PropertyGet: Expr -> (Expr option * System.Reflection.PropertyInfo * Expr list) option
union case Option.Some: Value: 'T -> Option<'T>
active recognizer PropertyGetterWithReflectedDefinition: System.Reflection.PropertyInfo -> Expr option
val failwith: message: string -> 'T
Evaluates implExpr to a quotation with the same structure as <@ fun (x: C<int>) () -> x @>, which is the implementation of the property Identity. Note that the correct generic instantiation has been applied to the implementation to reflect the type at the callsite.

(|PropertySetterWithReflectedDefinition|_|) propertyInfo

Full Usage: (|PropertySetterWithReflectedDefinition|_|) propertyInfo

Parameters:
    propertyInfo : PropertyInfo - The description of the property.

Returns: Expr option The expression of the method definition if found, or None.

An active pattern to recognize property setters that have an associated ReflectedDefinition

propertyInfo : PropertyInfo

The description of the property.

Returns: Expr option

The expression of the method definition if found, or None.

Example

 open FSharp.Quotations
 open FSharp.Quotations.Patterns
 open FSharp.Quotations.DerivedPatterns

 [<ReflectedDefinition>]
 type C<'T>() =
    member x.Count with set (v: int) = ()

 let inpExpr = <@ C<int>().Count <- 3 @>

 let implExpr =
     match inpExpr with
     | PropertySet(Some _, PropertySetterWithReflectedDefinition implExpr, [], _valueExpr) -> implExpr
     | _ -> failwith "unexpected"
Multiple items
namespace Microsoft.FSharp

--------------------
namespace FSharp
namespace Microsoft.FSharp.Quotations
namespace Microsoft.FSharp
module Patterns from Microsoft.FSharp.Quotations
module DerivedPatterns from Microsoft.FSharp.Quotations
Multiple items
type ReflectedDefinitionAttribute = inherit Attribute new: unit -> ReflectedDefinitionAttribute + 1 overload member IncludeValue: bool

--------------------
new: unit -> ReflectedDefinitionAttribute
new: includeValue: bool -> ReflectedDefinitionAttribute
type C<'T> = new: unit -> C<'T> member Count: int with set
'T
val x: C<'T>
val set: elements: 'T seq -> Set<'T> (requires comparison)
val v: int
Multiple items
val int: value: 'T -> int (requires member op_Explicit)

--------------------
type int = int32

--------------------
type int<'Measure> = int
val inpExpr: Expr<unit>
new: unit -> C<'T>
val implExpr: Expr
active recognizer PropertySet: Expr -> (Expr option * System.Reflection.PropertyInfo * Expr list * Expr) option
union case Option.Some: Value: 'T -> Option<'T>
active recognizer PropertySetterWithReflectedDefinition: System.Reflection.PropertyInfo -> Expr option
val _valueExpr: Expr
val failwith: message: string -> 'T
Evaluates implExpr to a quotation with the same structure as <@ fun (x: C<int>) (v: int) -> () @>, which is the implementation of the setter for the property Count. Note that the correct generic instantiation has been applied to the implementation to reflect the type at the callsite.

(|SByte|_|) input

Full Usage: (|SByte|_|) input

Parameters:
    input : Expr - The input expression to match against.

Returns: sbyte option When successful, the pattern binds the constant value from the input expression

An active pattern to recognize constant signed byte expressions

input : Expr

The input expression to match against.

Returns: sbyte option

When successful, the pattern binds the constant value from the input expression

Example

 open FSharp.Quotations.DerivedPatterns

 match <@ 8y @> with
 | SByte v -> v
 | _ -> failwith "unexpected"
Multiple items
namespace Microsoft.FSharp

--------------------
namespace FSharp
namespace Microsoft.FSharp.Quotations
module DerivedPatterns from Microsoft.FSharp.Quotations
active recognizer SByte: Quotations.Expr -> sbyte option
val v: sbyte
val failwith: message: string -> 'T
Evaluates to 8y.

(|Single|_|) input

Full Usage: (|Single|_|) input

Parameters:
    input : Expr - The input expression to match against.

Returns: float32 option When successful, the pattern binds the constant value from the input expression

An active pattern to recognize constant 32-bit floating point number expressions

input : Expr

The input expression to match against.

Returns: float32 option

When successful, the pattern binds the constant value from the input expression

Example

 open FSharp.Quotations.DerivedPatterns

 match <@ 1.0f @> with
 | Single v -> v
 | _ -> failwith "unexpected"
Multiple items
namespace Microsoft.FSharp

--------------------
namespace FSharp
namespace Microsoft.FSharp.Quotations
module DerivedPatterns from Microsoft.FSharp.Quotations
active recognizer Single: Quotations.Expr -> float32 option
val v: float32
val failwith: message: string -> 'T
Evaluates to 1.0f.

(|SpecificCall|_|) templateParameter

Full Usage: (|SpecificCall|_|) templateParameter

Parameters:
    templateParameter : Expr - The input template expression to specify the method to call.

Returns: Expr -> (Expr option * Type list * Expr list) option The optional target object (present if the target is an instance method), the generic type instantiation (non-empty if the target is a generic instantiation), and the arguments to the function or method.

A parameterized active pattern to recognize calls to a specified function or method. The returned elements are the optional target object (present if the target is an instance method), the generic type instantiation (non-empty if the target is a generic instantiation), and the arguments to the function or method.

templateParameter : Expr

The input template expression to specify the method to call.

Returns: Expr -> (Expr option * Type list * Expr list) option

The optional target object (present if the target is an instance method), the generic type instantiation (non-empty if the target is a generic instantiation), and the arguments to the function or method.

Example

Match a specific call to Console.WriteLine taking one string argument:

 open FSharp.Quotations
 open FSharp.Quotations.Patterns
 open FSharp.Quotations.DerivedPatterns

 let inpExpr = <@ Console.WriteLine("hello") @>

 match inpExpr with
 | SpecificCall <@ Console.WriteLine("1") @> (None, [], [ argExpr ]) -> argExpr
 | _ -> failwith "unexpected"
Multiple items
namespace Microsoft.FSharp

--------------------
namespace FSharp
namespace Microsoft.FSharp.Quotations
namespace Microsoft.FSharp
module Patterns from Microsoft.FSharp.Quotations
module DerivedPatterns from Microsoft.FSharp.Quotations
val inpExpr: Expr<obj>
active recognizer SpecificCall: Expr -> Expr -> (Expr option * System.Type list * Expr list) option
union case Option.None: Option<'T>
val argExpr: Expr
val failwith: message: string -> 'T
Evaluates to a quotation with the same structure as <@ "hello" @>.

Example

Calls to this active pattern can be partially applied to pre-evaluate some aspects of the matching. For example:

 open FSharp.Quotations
 open FSharp.Quotations.Patterns
 open FSharp.Quotations.DerivedPatterns

 let (|ConsoleWriteLineOneArg|_|) = (|SpecificCall|_|) <@ Console.WriteLine("1") @>

 let inpExpr = <@ Console.WriteLine("hello") @>

 match inpExpr with
 | ConsoleWriteLineOneArg (None, [], [ argExpr ]) -> argExpr
 | _ -> failwith "unexpected"
Multiple items
namespace Microsoft.FSharp

--------------------
namespace FSharp
namespace Microsoft.FSharp.Quotations
namespace Microsoft.FSharp
module Patterns from Microsoft.FSharp.Quotations
module DerivedPatterns from Microsoft.FSharp.Quotations
active recognizer SpecificCall: Expr -> Expr -> (Expr option * System.Type list * Expr list) option
val inpExpr: Expr<obj>
active recognizer ConsoleWriteLineOneArg: Expr<obj> -> (Expr option * System.Type list * Expr list) option
union case Option.None: Option<'T>
val argExpr: Expr
val failwith: message: string -> 'T
Evaluates to a quotation with the same structure as <@ "hello" @>.

(|String|_|) input

Full Usage: (|String|_|) input

Parameters:
    input : Expr - The input expression to match against.

Returns: string option When successful, the pattern binds the constant value from the input expression

An active pattern to recognize constant string expressions

input : Expr

The input expression to match against.

Returns: string option

When successful, the pattern binds the constant value from the input expression

Example

 open FSharp.Quotations.DerivedPatterns

 match <@ "a" @> with
 | String v -> v
 | _ -> failwith "unexpected"
Multiple items
namespace Microsoft.FSharp

--------------------
namespace FSharp
namespace Microsoft.FSharp.Quotations
module DerivedPatterns from Microsoft.FSharp.Quotations
Multiple items
active recognizer String: Quotations.Expr -> string option

--------------------
module String from Microsoft.FSharp.Core
val v: string
val failwith: message: string -> 'T
Evaluates to "a".

(|UInt16|_|) input

Full Usage: (|UInt16|_|) input

Parameters:
    input : Expr - The input expression to match against.

Returns: uint16 option When successful, the pattern binds the constant value from the input expression

An active pattern to recognize constant unsigned int16 expressions

input : Expr

The input expression to match against.

Returns: uint16 option

When successful, the pattern binds the constant value from the input expression

Example

 open FSharp.Quotations.DerivedPatterns

 match <@ 8us @> with
 | UInt16 v -> v
 | _ -> failwith "unexpected"
Multiple items
namespace Microsoft.FSharp

--------------------
namespace FSharp
namespace Microsoft.FSharp.Quotations
module DerivedPatterns from Microsoft.FSharp.Quotations
active recognizer UInt16: Quotations.Expr -> uint16 option
val v: uint16
val failwith: message: string -> 'T
Evaluates to 8us.

(|UInt32|_|) input

Full Usage: (|UInt32|_|) input

Parameters:
    input : Expr - The input expression to match against.

Returns: uint32 option When successful, the pattern binds the constant value from the input expression

An active pattern to recognize constant unsigned int32 expressions

input : Expr

The input expression to match against.

Returns: uint32 option

When successful, the pattern binds the constant value from the input expression

Example

 open FSharp.Quotations.DerivedPatterns

 match <@ 8u @> with
 | UInt32 v -> v
 | _ -> failwith "unexpected"
Multiple items
namespace Microsoft.FSharp

--------------------
namespace FSharp
namespace Microsoft.FSharp.Quotations
module DerivedPatterns from Microsoft.FSharp.Quotations
active recognizer UInt32: Quotations.Expr -> uint32 option
val v: uint32
val failwith: message: string -> 'T
Evaluates to 8u.

(|UInt64|_|) input

Full Usage: (|UInt64|_|) input

Parameters:
    input : Expr - The input expression to match against.

Returns: uint64 option When successful, the pattern binds the constant value from the input expression

An active pattern to recognize constant unsigned int64 expressions

input : Expr

The input expression to match against.

Returns: uint64 option

When successful, the pattern binds the constant value from the input expression

Example

 open FSharp.Quotations.DerivedPatterns

 match <@ 8UL @> with
 | UInt64 v -> v
 | _ -> failwith "unexpected"
Multiple items
namespace Microsoft.FSharp

--------------------
namespace FSharp
namespace Microsoft.FSharp.Quotations
module DerivedPatterns from Microsoft.FSharp.Quotations
active recognizer UInt64: Quotations.Expr -> uint64 option
val v: uint64
val failwith: message: string -> 'T
Evaluates to 8UL.

(|Unit|_|) input

Full Usage: (|Unit|_|) input

Parameters:
    input : Expr - The input expression to match against.

Returns: unit option When successful, the pattern does not bind any results

An active pattern to recognize () constant expressions

input : Expr

The input expression to match against.

Returns: unit option

When successful, the pattern does not bind any results

Example

 open FSharp.Quotations.DerivedPatterns

 match <@ () @> with
 | Unit v -> v
 | _ -> failwith "unexpected"
Multiple items
namespace Microsoft.FSharp

--------------------
namespace FSharp
namespace Microsoft.FSharp.Quotations
module DerivedPatterns from Microsoft.FSharp.Quotations
active recognizer Unit: Quotations.Expr -> unit option
val v: unit
val failwith: message: string -> 'T
Evaluates to true.

Type something to start searching.