Qit


Quote Module

Functions for transforming, evaluation, and inspecting Expr and Expr<'a> objects.

Functions and values

Function or value Description

any name

Full Usage: any name

Parameters:
    name : 'a - Name of the marker to later retreive the match

Returns: AnyType

Used within a quotation to match an Expr of any type.

name : 'a

Name of the marker to later retreive the match

Returns: AnyType

applySubtitution f expr

Full Usage: applySubtitution f expr

Parameters:
Returns: Expr

Apply a substitution to the expr.

f : Expr list -> Expr -> (Expr * Expr) option

Substitutionn

expr : Expr

Target Expr

Returns: Expr

compileLambda expr

Full Usage: compileLambda expr

Parameters:
    expr : Expr<'a> - Expr to compile

Returns: 'a

Compiles Expr on lambda into an assembly and returns the lambda.

expr : Expr<'a>

Expr to compile

Returns: 'a

compileLambdaWithRefs refs expr

Full Usage: compileLambdaWithRefs refs expr

Parameters:
    refs : Assembly seq - Assembly references to include
    expr : Expr<'a> - Target expr

Returns: 'a

Compiles Expr on lambda into an assembly and returns the lambda. Additional assembly references can be specified.

refs : Assembly seq

Assembly references to include

expr : Expr<'a>

Target expr

Returns: 'a

contains query expr

Full Usage: contains query expr

Parameters:
    query : Expr - Expr to search for
    expr : Expr - Target Expr

Returns: bool

Tests if the Expr contains the specified Expr.

query : Expr

Expr to search for

expr : Expr

Target Expr

Returns: bool

decomposeLetBindings expr

Full Usage: decomposeLetBindings expr

Parameters:
    expr : Expr - Target Expr

Returns: (Var * Expr) list * Expr Var*Expr bindings and body Expr

Extract succesive let bindings from an expression

expr : Expr

Target Expr

Returns: (Var * Expr) list * Expr

Var*Expr bindings and body Expr

evaluate expr

Full Usage: evaluate expr

Parameters:
    expr : Expr<'a> - ('a Expr) to evaluate

Returns: 'a Result of evaluation

Evaluate a ('a Expr)

expr : Expr<'a>

('a Expr) to evaluate

Returns: 'a

Result of evaluation

evaluateUntyped expr

Full Usage: evaluateUntyped expr

Parameters:
    expr : Expr - Expr to evaluate

Returns: obj Result of evaluation

Evaluate Expr

expr : Expr

Expr to evaluate

Returns: obj

Result of evaluation

exists predicate expr

Full Usage: exists predicate expr

Parameters:
    predicate : Expr -> bool - (Expr -> bool) to be applied to each sub-Expr
    expr : Expr - Target Expr

Returns: bool

Tests if any sub-Expr of the Expr satisfies the predicate

predicate : Expr -> bool

(Expr -> bool) to be applied to each sub-Expr

expr : Expr

Target Expr

Returns: bool

expand vars expr

Full Usage: expand vars expr

Parameters:
Returns: Expr Expanded Expr

Expand let bindings in Expr

vars : Map<Var, Expr>

Var replacements

expr : Expr

Target Expr

Returns: Expr

Expanded Expr

expandExpressionSplices e

Full Usage: expandExpressionSplices e

Parameters:
    e : 'e

Returns: 'e
e : 'e
Returns: 'e

expandLambda expr

Full Usage: expandLambda expr

Parameters:
    expr : Expr - Target Expr

Returns: Expr

Will expand the application of a lambda expression to a let binding

expr : Expr

Target Expr

Returns: Expr

expandOperators expr

Full Usage: expandOperators expr

Parameters:
    expr : Expr<'a> - Target Expr

Returns: Expr<'a> Transformed Expr

Expand all Qit operators in Expr.

expr : Expr<'a>

Target Expr

Returns: Expr<'a>

Transformed Expr

expandOperatorsUnchecked expr

Full Usage: expandOperatorsUnchecked expr

Parameters:
    expr : Expr - Target Expr

Returns: Expr Transformed Expr

Expand all Qit operators in expresion. Unchecked version will skip type checks when building the expression.

expr : Expr

Target Expr

Returns: Expr

Transformed Expr

expandOperatorsUntyped expr

Full Usage: expandOperatorsUntyped expr

Parameters:
    expr : Expr - Target Expr

Returns: Expr Transformed Expr

Expand all Qit operators in untyped expresion.

expr : Expr

Target Expr

Returns: Expr

Transformed Expr

expandRewriters expr

Full Usage: expandRewriters expr

Parameters:
    expr : Expr - Target Expr

Returns: Expr Transformed Expr

Expand all rewriters in Expr.

expr : Expr

Target Expr

Returns: Expr

Transformed Expr

exprMatch a b

Full Usage: exprMatch a b

Parameters:
    a : Expr - Expr to compare
    b : Expr - Expr to compare

Returns: Dictionary<string, Expr> * Dictionary<string, Expr> * bool untypedMarkers:Dictionary * typedMarkers : Dictionary * matchResult : bool

Attempts to match two Expr trees against each other. Quote.anyType and Quote.typed<'a> markers are extracted. Variables starting with __ are treated as wildcards, otherwise their names must match.

a : Expr

Expr to compare

b : Expr

Expr to compare

Returns: Dictionary<string, Expr> * Dictionary<string, Expr> * bool

untypedMarkers:Dictionary * typedMarkers : Dictionary * matchResult : bool

genericMethodInfo expr

Full Usage: genericMethodInfo expr

Parameters:
    expr : Expr - Expr to extract MethodInfo from

Returns: MethodInfo MethodInfo

Extract MethodInfo from simple Expr. If the method is generic it will further extract the generic method info.

expr : Expr

Expr to extract MethodInfo from

Returns: MethodInfo

MethodInfo

isEquivalent a b

Full Usage: isEquivalent a b

Parameters:
    a : Expr - Expr to check
    b : Expr - Expr to check

Returns: bool

Check for equivalence between Exprs.

a : Expr

Expr to check

b : Expr

Expr to check

Returns: bool

methodInfo expr

Full Usage: methodInfo expr

Parameters:
    expr : Expr - Expr to extract MethodInfo from

Returns: MethodInfo MethodInfo

Extract MethodInfo from simple Expr

expr : Expr

Expr to extract MethodInfo from

Returns: MethodInfo

MethodInfo

replaceVar targetVar replacementVar expr

Full Usage: replaceVar targetVar replacementVar expr

Parameters:
    targetVar : Var - Target var
    replacementVar : Expr - Replacement Var
    expr : Expr - Target Expr

Returns: Expr Transformed Expr

Replace every occurence of targetVar with replacementVar in expr.

targetVar : Var

Target var

replacementVar : Expr

Replacement Var

expr : Expr

Target Expr

Returns: Expr

Transformed Expr

str q

Full Usage: str q

Parameters:
Returns: string

Simplified string representation of Expr

q : Expr
Returns: string

toExpression expr

Full Usage: toExpression expr

Parameters:
Returns: Expression

Expr<'a> to System.Linq.Expressions.Expression

expr : Expr<'a>
Returns: Expression

toFuncExpression x

Full Usage: toFuncExpression x

Parameters:
Returns: Expression<'a0>

Convert Expr of a F# function to an Expression.Lambda

x : Expr<'a>

Returns: Expression<'a0>

toFuncExpression0 f

Full Usage: toFuncExpression0 f

Parameters:
Returns: Expression<Func<'a>>
f : Expr<'a>
Returns: Expression<Func<'a>>

toFuncExpression1 f

Full Usage: toFuncExpression1 f

Parameters:
    f : Expr<('a -> 'b)>

Returns: Expression<Func<'a, 'b>>
f : Expr<('a -> 'b)>
Returns: Expression<Func<'a, 'b>>

toFuncExpression2 f

Full Usage: toFuncExpression2 f

Parameters:
    f : Expr<('a -> 'b -> 'c)>

Returns: Expression<Func<'a, 'b, 'c>>
f : Expr<('a -> 'b -> 'c)>
Returns: Expression<Func<'a, 'b, 'c>>

toFuncExpression3 f

Full Usage: toFuncExpression3 f

Parameters:
    f : Expr<('a -> 'b -> 'c -> 'd)>

Returns: Expression<Func<'a, 'b, 'c, 'd>>
f : Expr<('a -> 'b -> 'c -> 'd)>
Returns: Expression<Func<'a, 'b, 'c, 'd>>

toFuncExpression4 f

Full Usage: toFuncExpression4 f

Parameters:
    f : Expr<('a -> 'b -> 'c -> 'd -> 'e)>

Returns: Expression<Func<'a, 'b, 'c, 'd, 'e>>
f : Expr<('a -> 'b -> 'c -> 'd -> 'e)>
Returns: Expression<Func<'a, 'b, 'c, 'd, 'e>>

toFuncExpression5 f

Full Usage: toFuncExpression5 f

Parameters:
    f : Expr<('a -> 'b -> 'c -> 'd -> 'e -> 'f)>

Returns: Expression<Func<'a, 'b, 'c, 'd, 'e, 'f>>
f : Expr<('a -> 'b -> 'c -> 'd -> 'e -> 'f)>
Returns: Expression<Func<'a, 'b, 'c, 'd, 'e, 'f>>

toFuncExpression6 f

Full Usage: toFuncExpression6 f

Parameters:
    f : Expr<('a -> 'b -> 'c -> 'd -> 'e -> 'f -> 'g)>

Returns: Expression<Func<'a, 'b, 'c, 'd, 'e, 'f, 'g>>
f : Expr<('a -> 'b -> 'c -> 'd -> 'e -> 'f -> 'g)>
Returns: Expression<Func<'a, 'b, 'c, 'd, 'e, 'f, 'g>>

toFuncExpression7 f

Full Usage: toFuncExpression7 f

Parameters:
    f : Expr<('a -> 'b -> 'c -> 'd -> 'e -> 'f -> 'g -> 'h)>

Returns: Expression<Func<'a, 'b, 'c, 'd, 'e, 'f, 'g, 'h>>
f : Expr<('a -> 'b -> 'c -> 'd -> 'e -> 'f -> 'g -> 'h)>
Returns: Expression<Func<'a, 'b, 'c, 'd, 'e, 'f, 'g, 'h>>

toFuncExpression8 f

Full Usage: toFuncExpression8 f

Parameters:
    f : Expr<('a -> 'b -> 'c -> 'd -> 'e -> 'f -> 'g -> 'h -> 'i)>

Returns: Expression<Func<'a, 'b, 'c, 'd, 'e, 'f, 'g, 'h, 'i>>
f : Expr<('a -> 'b -> 'c -> 'd -> 'e -> 'f -> 'g -> 'h -> 'i)>
Returns: Expression<Func<'a, 'b, 'c, 'd, 'e, 'f, 'g, 'h, 'i>>

traverse f expr

Full Usage: traverse f expr

Parameters:
    f : Expr -> Expr option - Traversal function
    expr : Expr - Target Expr

Returns: Expr Transformed Expr

Traverse quotation applying function to each subexpression, if the function returns None the subexpression is left unchanged.

f : Expr -> Expr option

Traversal function

expr : Expr

Target Expr

Returns: Expr

Transformed Expr

traverseRecursive f expr

Full Usage: traverseRecursive f expr

Parameters:
    f : Expr -> (bool * Expr) option - Traversal function
    expr : Expr - Target Expr

Returns: Expr Transformed Expr

Traverse quotation applying function to each subexpression, if the function returns None the subexpression is left unchanged. If the function returns Some(true,expr) the subexpression is replaced with expr and the traversal continues on expr. If the function returns Some(false,expr) the subexpression is replaced with expr and the traversal stops.

f : Expr -> (bool * Expr) option

Traversal function

expr : Expr

Target Expr

Returns: Expr

Transformed Expr

traverseUnchecked f expr

Full Usage: traverseUnchecked f expr

Parameters:
    f : Expr -> Expr option - Traversal function
    expr : Expr - Target Expr

Returns: Expr Transformed Expr

Traverse quotation applying function to each subexpression, if the function returns None the subexpression is left unchanged. Uncheckd version skips type checks when building the Expr.

f : Expr -> Expr option

Traversal function

expr : Expr

Target Expr

Returns: Expr

Transformed Expr

typed expr

Full Usage: typed expr

Parameters:
    expr : Expr - Raw Expr to cast

Returns: Expr<'a> Typed Expr

Raw Expr to typed Expr

expr : Expr

Raw Expr to cast

Returns: Expr<'a>

Typed Expr

untyped q

Full Usage: untyped q

Parameters:
Returns: Expr Raw Expr

Typed Expr to Raw Expr

q : Expr<'a>
Returns: Expr

Raw Expr

withType name

Full Usage: withType name

Parameters:
    name : string - Name of the marker to later retreive the match

Returns: 'a

Used within a quotation to match an Expr of specific type.

name : string

Name of the marker to later retreive the match

Returns: 'a