Patterns.TryWith Active Pattern (F#)
Recognizes expressions that represent a try...with construct for exception filtering and catching.
Namespace/Module Path: Microsoft.FSharp.Quotations.Patterns
Assembly: FSharp.Core (in FSharp.Core.dll)
The formal return type is (Expr * Var * Expr * Var * Expr) option. The option indicates whether a successful match is made. In a pattern matching expression, upon a successful match, the input expression is decomposed into a tuple of five elements. The first element is an expression that represents the body of the try...with expression. The second element is the filter value, which is the value that is used to compare against the patterns. The third element is an expression that represents the filtering and assignment of any values set in the pattern matching (for example, by using the as keyword). The fourth element is the catch value, which is usually the same as the filter value and is used to determine which branch is taken. The final element is the catch expression, which includes the branching code. The tuple elements correspond to the arguments of the Expr.TryWith method.