SyntaxOak Module
Types
| Type | Description |
|
|
|
|
The content from [< to >] |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Example: `struct {| Name = "Alice"; Age = 30 |}` — an anonymous struct record expression. Extends `ExprRecordNode` by prepending the `struct` keyword. |
|
|
Example: `List.map(f)` — a qualified name (dotted identifier) applied to a single parenthesised argument |
|
|
Example: `List.map f xs` — a function applied to two or more space-separated arguments |
|
|
Example: `f(a)` — a general expression (not a simple dotted name) applied to a single parenthesised argument |
|
|
Example: `List.map (fun x -> x + 1) xs` — a function applied to zero or more prefix arguments followed by a parenthesised lambda or `function` expression as the last argument. |
|
|
Example: `[a; b; c]` for a list, `[|a; b; c|]` for an array — determined by the opening/closing tokens |
|
|
Example: `begin expr end` — explicit `begin`/`end` block delimiters (equivalent to parentheses). |
|
|
Example: `person.Address.City.ToUpper()` — a chain of dot-separated member accesses and calls |
|
|
The body of a computation expression, consisting of an ordered list of binding statements (e.g. `let! x = …`) and other expressions (e.g. `return x`, `do! f()`). |
|
|
Example: `{ let x = 1; yield x }` — an anonymous computation expression (no explicit builder name). |
|
|
A constant (literal) expression leaf node such as `42`, `"hello"`, `true`, or `3.14`. This node has no child nodes; all textual content is carried by the source range. |
|
|
Example: `arr.[i]` — indexed get using the older dot-bracket syntax (deprecated in F# 6). |
|
|
Example: `arr.[i] <- value` — indexed set using the older dot-bracket syntax (deprecated in F# 6). |
|
|
Example: `_.ToUpper()` or `_.Length` — a dot-lambda shorthand (F# 8+). `Underscore` is the `_` placeholder, `Dot` is the `.`, and `Expr` is the member access or call. |
|
|
Example: `obj.Item[key] <- value` — sets a named indexed property accessed through a dotted expression. |
|
|
Example: `obj?Property` — dynamic member access using the `?` operator. `FuncExpr` is the object; `ArgExpr` is the property name (often a string constant). |
|
|
then |
|
|
Example: `for x in xs do printfn "%A" x` — a `for … in` loop over a sequence. `IsArrow` is `true` when using arrow syntax (`for x in xs -> expr`) instead of `do`. |
|
|
Example: `for i = 1 to 10 do printfn "%d" i` or `for i = 10 downto 1 do …`. `Direction` is `true` for ascending (`to`) and `false` for descending (`downto`). |
|
|
Example: `if a then x elif b then y else z` — contains one or more `if/elif` branches and an optional `else` |
|
|
Example: `if condition then trueResult else falseResult` |
|
|
Example: `if condition then result` |
|
|
Example: `^1` or `^0` — an end-relative index expression (from-end indexer, F# 6+). |
|
|
Example: `0..10`, `..10`, `0..`, `..` — a two-part index range (used in slice expressions and list comprehensions). Either `From` or `To` (or both) may be absent, producing an open-ended range. |
|
|
Example: `xs[i]` — index access using the new F# 6+ dot-free bracket syntax. `Identifier` is the collection; `Index` is the index expression inside `[…]`. |
|
|
Example: `a + b` — a single binary infix application with two different operands or operators |
|
|
Example: `{ inherit Base(args); Field = value }` — a record with an `inherit` constructor call. |
|
|
Example: `$"hello {name}, you are {age} years old"` — an interpolated string expression. `Parts` interleaves raw string `SingleTextNode` segments with `FillExprNode` interpolation holes. |
|
|
Example: `e1 in e2` — used in query-expression `join … in …` clauses; represents the `in` operator. |
|
|
Example: `fun x y -> x + y` |
|
|
Example: `lazy computeExpensiveValue` |
|
|
Internal compiler node for static optimisation hints (library/compiler use only, not user-facing). Emits an expression with attached `StaticOptimizationConstraint` conditions. |
|
|
Example: `Module.mutableValue <- newValue` — mutation via a long (dotted) identifier. |
|
|
Example: `function | Some x -> x | None -> defaultValue` |
|
|
Example: `match x with | Some v -> v | None -> 0` |
|
|
Example: `task { … }` or `async { … }` — a named computation expression with an explicit builder. The builder expression (`Name`) precedes the braces of the computation body. |
|
|
Example: `myProp[key] <- value` — sets a named indexed property on a type. |
|
|
Example: `xs[i] arg` — an indexed expression (`xs[i]`) immediately applied to an argument. Used for cases like `arr[0] + 1` where the index result is itself called or applied. |
|
|
Example: `new StringBuilder(capacity)` |
|
|
Example: `{ new IDisposable with member _.Dispose() = () }` — an object expression that implements an interface or inherits a base class inline. |
|
|
Example: `?name` in a function call — a named optional argument passed explicitly. `IsOptional` is `true` when the `?` prefix is present; `Identifier` is the argument name. |
|
|
Example: `( * )` or `( + )` — an operator name wrapped in parentheses, used as a first-class function value. |
|
|
Example: `(fun x -> x + 1)` — a lambda expression wrapped in parentheses. Distinct from `ExprLambdaNode` in that the parens are explicit and tracked as nodes. |
|
|
Example: `(expr)` — an expression explicitly wrapped in parentheses for grouping or disambiguation. |
|
|
Example: `!x`, `-x`, `~~~x` — a prefix (unary) operator applied to an expression. |
|
|
Example: `<@ expr @>` — a typed quotation; `<@@ expr @@>` — an untyped quotation. The opening and closing tokens capture the bracket pair; `Expr` is the quoted expression. |
|
|
Abstract base for all record expression nodes, providing shared access to the braces and fields. |
|
|
Represents a record instance, parsed from both `SynExpr.Record` and `SynExpr.AnonRecd`. |
|
|
Example: `a + b + c` — a sequence of the *same* operator applied repeatedly (avoids redundant nesting) |
|
|
Example: `x <- newValue` — an imperative assignment (mutation) expression. |
|
|
A single expression prefixed by a keyword, e.g. `assert condition`, `yield value`, `return result`, `upcast expr`, `downcast expr`, `do expr`, `do! asyncExpr`, `return! asyncExpr`. `AddSpace` controls whether a space is emitted between the keyword and the expression. |
|
|
Example: `struct (a, b, c)` — a struct tuple expression. Wraps an `ExprTupleNode` and adds the `struct` keyword and a closing parenthesis. |
|
|
Example: `(^T : (member Get : unit -> int) t)` — a statically-resolved type parameter (SRTP) trait call. Invokes `MemberDefn` on value `Expr` constrained to type `Type` at compile time. |
|
|
Example: `0..2..10` — a three-part numeric range with start, step, and end values (used in slice expressions). |
|
|
Example: `try riskyOp() finally cleanup()` — a try/finally expression that always runs `FinallyExpr`. |
|
|
Example: `try riskyOp() with | :? IOException -> "IO" | ex -> sprintf "other: %O" ex` — a try/with with multiple match clauses. |
|
|
Example: `try riskyOp() with :? IOException -> "IO error"` — a try/with with exactly one match clause. Used as an optimised form when a single pattern covers all exception cases. |
|
|
Example: `(a, b, c)` — items are interleaved with comma `SingleTextNode` separators |
|
|
Example: `id |
|
|
Example: `expr : Type` (type annotation), `expr :? Type` (type test / downcast), `expr :>> Type` (upcast). `Operator` holds the specific type operator string (`:`, `:?`, `:>`, `:>>`). |
|
|
Example: `while i < 10 do printfn "%d" i; i <- i + 1` — a while loop. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Secondary constructor new (pat: type) = expr |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Each case in this DU should have a container node |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Example: `pat1 & pat2 & pat3` |
|
|
Example: `[a; b; c]` (list pattern) or `[| a; b; c |]` (array pattern) |
|
|
Example: `:? SomeType` (a type-test pattern) |
|
|
A pattern composed from a left hand-side pattern, a single text token/operator and a right hand-side pattern. Example (Or): `A | B` Example (As): `x as y` Example (ListCons): `head :: tail` |
|
|
Example: `Some x` or `MyModule.MyDU value` (a union case or long-ident pattern with optional sub-patterns) |
|
|
Example: `MyUnion(field1 = x; field2 = y)` (named field patterns on a union case) |
|
|
Example: `x` or `private x` (a simple named binding pattern) |
|
|
Example: `( * )` (operator name used as a pattern in member definitions) |
|
|
Example: `[ |
|
|
Example: `(pat)` (a parenthesised pattern) |
|
|
Example: `{ Field1 = x; Field2 = y }` (a record pattern) |
|
|
Example: `struct (a, b)` (a struct tuple pattern) |
|
|
Example: `a, b, c` (a tuple pattern) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Example: `{| Name: string; Age: int |}` or `struct {| X: float |}` — an anonymous record type. |
|
|
Example: `int list` or `string option` — a postfix type application where the type argument precedes the type name. |
|
|
Example: `List |
|
|
Example: `int[]` (rank 1) or `int[,]` (rank 2) — an array type with a base element type and a rank. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
`'T: not null` in `type C<'T when 'T: not null> = class end` |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Example: `int -> string -> bool` — a function type with one or more parameters and a return type. Each parameter is paired with its arrow token; the final element is the return type. |
|
|
Example: `#IDisposable` — a flexible/hash constraint type that matches any subtype. |
|
|
Example: `IFoo & IBar` — an intersection type (F# 9+), combining multiple types with `&` separators. |
|
|
Example: `Map |
|
|
Example: `m^2` — a measure type raised to a rational power (used in units of measure). |
|
|
|
|
|
Example: `A or B` — an F# 9+ type union (disjunction) used in type constraints and signatures. |
|
|
Example: `(int -> string)` — a parenthesised type, used to clarify precedence or wrap a type in parens. |
|
|
Example: `?x: int` or `[ |
|
|
Example: `const 42` — a static constant expression used as a type argument (e.g. in inline F# code or SRTP). |
|
|
Example: `N=3` — a named static constant type, pairing an identifier type with a value type (e.g. in SRTP constraints). |
|
|
Example: `struct (int * string)` — a struct tuple type, distinguishable from a reference tuple by the `struct` keyword. |
|
|
Example: `int * string * bool` — a tuple type. Path interleaves the component types with `*` separators. |
|
|
Example: `'T when 'T : equality` — a type paired with one or more type constraints that apply globally. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
fantomas