Patterns.Lambda Active Pattern (F#)

Recognizes expressions that represent first-class function values.

Namespace/Module Path: Microsoft.FSharp.Quotations.Patterns

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

// Signature:
( |Lambda|_| ) : (input:Expr) -> (Var * Expr) option

input

Type: Expr

The input expression to match against.

The formal return type is (Var * Expr) option. The option indicates whether the input results in a match. In a pattern matching expression, the input is decomposed, upon a successful match, into a tuple of two elements. The first element is a Var object that represents a single argument. The second object is an expression that represents the body of the lambda expression. Lambda expressions that have multiple arguments are decomposed one argument at a time. For example, a lambda expression that has two arguments is decomposed so that the Var element is the first argument, and the Expr element is a lambda expression that can be recursively decomposed so that the second-level Var element is the second argument and the second-level Expr element is the body.

This function is named LambdaPattern in the .NET Framework assembly. If you are accessing the member from a .NET Framework language other than F#, or through reflection, use this name.

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

F# Core Library Versions

Supported in: 2.0, 4.0, Portable

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft