Header menu logo fantomas

SyntaxOak Module

Types

Type Description

AsSelfIdentifierNode

AttributeListNode

The content from [< to >]

AttributeNode

BindingListNode

BindingNode

BindingReturnInfoNode

ChainLink

ComputationExpressionStatement

Constant

ConstantMeasureNode

ElseIfNode

EnumCaseNode

ExceptionDefnNode

Expr

ExprAnonStructRecordNode

Example: `struct {| Name = "Alice"; Age = 30 |}` — an anonymous struct record expression. Extends `ExprRecordNode` by prepending the `struct` keyword.

ExprAppLongIdentAndSingleParenArgNode

Example: `List.map(f)` — a qualified name (dotted identifier) applied to a single parenthesised argument

ExprAppNode

Example: `List.map f xs` — a function applied to two or more space-separated arguments

ExprAppSingleParenArgNode

Example: `f(a)` — a general expression (not a simple dotted name) applied to a single parenthesised argument

ExprAppWithLambdaNode

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.

ExprArrayOrListNode

Example: `[a; b; c]` for a list, `[|a; b; c|]` for an array — determined by the opening/closing tokens

ExprBeginEndNode

Example: `begin expr end` — explicit `begin`/`end` block delimiters (equivalent to parentheses).

ExprChain

Example: `person.Address.City.ToUpper()` — a chain of dot-separated member accesses and calls

ExprCompExprBodyNode

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()`).

ExprComputationNode

Example: `{ let x = 1; yield x }` — an anonymous computation expression (no explicit builder name).

ExprConstantNode

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.

ExprDotIndexedGetNode

Example: `arr.[i]` — indexed get using the older dot-bracket syntax (deprecated in F# 6).

ExprDotIndexedSetNode

Example: `arr.[i] <- value` — indexed set using the older dot-bracket syntax (deprecated in F# 6).

ExprDotLambda

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.

ExprDotNamedIndexedPropertySetNode

Example: `obj.Item[key] <- value` — sets a named indexed property accessed through a dotted expression.

ExprDynamicNode

Example: `obj?Property` — dynamic member access using the `?` operator. `FuncExpr` is the object; `ArgExpr` is the property name (often a string constant).

ExprExplicitConstructorThenExpr

then Only valid in secondary constructors, original coming from SynExpr.Sequential(trivia = { SeparatorRange = Some mThen })

ExprForEachNode

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`.

ExprForNode

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`).

ExprIfThenElifNode

Example: `if a then x elif b then y else z` — contains one or more `if/elif` branches and an optional `else`

ExprIfThenElseNode

Example: `if condition then trueResult else falseResult`

ExprIfThenNode

Example: `if condition then result`

ExprIndexFromEndNode

Example: `^1` or `^0` — an end-relative index expression (from-end indexer, F# 6+).

ExprIndexRangeNode

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.

ExprIndexWithoutDotNode

Example: `xs[i]` — index access using the new F# 6+ dot-free bracket syntax. `Identifier` is the collection; `Index` is the index expression inside `[…]`.

ExprInfixAppNode

Example: `a + b` — a single binary infix application with two different operands or operators

ExprInheritRecordNode

Example: `{ inherit Base(args); Field = value }` — a record with an `inherit` constructor call.

ExprInterpolatedStringExprNode

Example: `$"hello {name}, you are {age} years old"` — an interpolated string expression. `Parts` interleaves raw string `SingleTextNode` segments with `FillExprNode` interpolation holes.

ExprJoinInNode

Example: `e1 in e2` — used in query-expression `join … in …` clauses; represents the `in` operator.

ExprLambdaNode

Example: `fun x y -> x + y`

ExprLazyNode

Example: `lazy computeExpensiveValue`

ExprLibraryOnlyStaticOptimizationNode

Internal compiler node for static optimisation hints (library/compiler use only, not user-facing). Emits an expression with attached `StaticOptimizationConstraint` conditions.

ExprLongIdentSetNode

Example: `Module.mutableValue <- newValue` — mutation via a long (dotted) identifier.

ExprMatchLambdaNode

Example: `function | Some x -> x | None -> defaultValue`

ExprMatchNode

Example: `match x with | Some v -> v | None -> 0`

ExprNamedComputationNode

Example: `task { … }` or `async { … }` — a named computation expression with an explicit builder. The builder expression (`Name`) precedes the braces of the computation body.

ExprNamedIndexedPropertySetNode

Example: `myProp[key] <- value` — sets a named indexed property on a type.

ExprNestedIndexWithoutDotNode

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.

ExprNewNode

Example: `new StringBuilder(capacity)`

ExprObjExprNode

Example: `{ new IDisposable with member _.Dispose() = () }` — an object expression that implements an interface or inherits a base class inline.

ExprOptVarNode

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.

ExprParenFunctionNameWithStarNode

Example: `( * )` or `( + )` — an operator name wrapped in parentheses, used as a first-class function value.

ExprParenLambdaNode

Example: `(fun x -> x + 1)` — a lambda expression wrapped in parentheses. Distinct from `ExprLambdaNode` in that the parens are explicit and tracked as nodes.

ExprParenNode

Example: `(expr)` — an expression explicitly wrapped in parentheses for grouping or disambiguation.

ExprPrefixAppNode

Example: `!x`, `-x`, `~~~x` — a prefix (unary) operator applied to an expression.

ExprQuoteNode

Example: `<@ expr @>` — a typed quotation; `<@@ expr @@>` — an untyped quotation. The opening and closing tokens capture the bracket pair; `Expr` is the quoted expression.

ExprRecordBaseNode

Abstract base for all record expression nodes, providing shared access to the braces and fields.

ExprRecordNode

Represents a record instance, parsed from both `SynExpr.Record` and `SynExpr.AnonRecd`.

ExprSameInfixAppsNode

Example: `a + b + c` — a sequence of the *same* operator applied repeatedly (avoids redundant nesting)

ExprSetNode

Example: `x <- newValue` — an imperative assignment (mutation) expression.

ExprSingleNode

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.

ExprStructTupleNode

Example: `struct (a, b, c)` — a struct tuple expression. Wraps an `ExprTupleNode` and adds the `struct` keyword and a closing parenthesis.

ExprTraitCallNode

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.

ExprTripleNumberIndexRangeNode

Example: `0..2..10` — a three-part numeric range with start, step, and end values (used in slice expressions).

ExprTryFinallyNode

Example: `try riskyOp() finally cleanup()` — a try/finally expression that always runs `FinallyExpr`.

ExprTryWithNode

Example: `try riskyOp() with | :? IOException -> "IO" | ex -> sprintf "other: %O" ex` — a try/with with multiple match clauses.

ExprTryWithSingleClauseNode

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.

ExprTupleNode

Example: `(a, b, c)` — items are interleaved with comma `SingleTextNode` separators

ExprTypeAppNode

Example: `id` or `List.empty` — a generic type application using angle-bracket syntax.

ExprTypedNode

Example: `expr : Type` (type annotation), `expr :? Type` (type test / downcast), `expr :>> Type` (upcast). `Operator` holds the specific type operator string (`:`, `:?`, `:>`, `:>>`).

ExprWhileNode

Example: `while i < 10 do printfn "%d" i; i <- i + 1` — a while loop.

ExternBindingNode

ExternBindingPatternNode

FieldNode

FillExprNode

HashDirectiveListNode

ITypeDefn

IdentListNode

IdentifierOrDot

IfKeywordNode

ImplicitConstructorNode

InfixApp

InheritConstructor

InheritConstructorOtherNode

InheritConstructorParenNode

InheritConstructorTypeOnlyNode

InheritConstructorUnitNode

InterfaceImplNode

LinkSingleAppParen

LinkSingleAppUnit

MatchClauseNode

Measure

MeasureDivideNode

MeasureOperatorNode

MeasureParenNode

MeasurePowerNode

MeasureSequenceNode

MemberDefn

MemberDefnAbstractSlotNode

MemberDefnAutoPropertyNode

MemberDefnExplicitCtorNode

Secondary constructor new (pat: type) = expr

MemberDefnInheritNode

MemberDefnInterfaceNode

MemberDefnPropertyGetSetNode

MemberDefnSigMemberNode

ModuleAbbrevNode

ModuleDecl

Each case in this DU should have a container node

ModuleDeclAttributesNode

ModuleOrNamespaceHeaderNode

ModuleOrNamespaceNode

MultipleAttributeListNode

MultipleTextsNode

NamePatPairNode

NegateRationalNode

NestedModuleNode

Node

NodeBase

Oak

Open

OpenListNode

OpenModuleOrNamespaceNode

OpenTargetNode

ParsedHashDirectiveNode

PatAndsNode

Example: `pat1 & pat2 & pat3`

PatArrayOrListNode

Example: `[a; b; c]` (list pattern) or `[| a; b; c |]` (array pattern)

PatIsInstNode

Example: `:? SomeType` (a type-test pattern)

PatLeftMiddleRight

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`

PatLongIdentNode

Example: `Some x` or `MyModule.MyDU value` (a union case or long-ident pattern with optional sub-patterns)

PatNamePatPairsNode

Example: `MyUnion(field1 = x; field2 = y)` (named field patterns on a union case)

PatNamedNode

Example: `x` or `private x` (a simple named binding pattern)

PatNamedParenStarIdentNode

Example: `( * )` (operator name used as a pattern in member definitions)

PatParameterNode

Example: `[] pat: Type` (attributed/typed parameter pattern)

PatParenNode

Example: `(pat)` (a parenthesised pattern)

PatRecordNode

Example: `{ Field1 = x; Field2 = y }` (a record pattern)

PatStructTupleNode

Example: `struct (a, b)` (a struct tuple pattern)

PatTupleNode

Example: `a, b, c` (a tuple pattern)

Pattern

PropertyGetSetBindingNode

RationalConstNode

RationalNode

RecordFieldNode

SingleTextNode

StaticOptimizationConstraint

StaticOptimizationConstraintWhenTyparTyconEqualsTyconNode

StringNode

TriviaContent

TriviaNode

TyparDeclNode

TyparDecls

TyparDeclsPostfixListNode

TyparDeclsPrefixListNode

Type

TypeAnonRecordNode

Example: `{| Name: string; Age: int |}` or `struct {| X: float |}` — an anonymous record type.

TypeAppPostFixNode

Example: `int list` or `string option` — a postfix type application where the type argument precedes the type name.

TypeAppPrefixNode

Example: `List` or `Dictionary` — a prefix type application with angle-bracket type arguments.

TypeArrayNode

Example: `int[]` (rank 1) or `int[,]` (rank 2) — an array type with a base element type and a rank.

TypeConstraint

TypeConstraintDefaultsToTypeNode

TypeConstraintEnumOrDelegateNode

TypeConstraintSingleNode

TypeConstraintSubtypeOfTypeNode

TypeConstraintSupportsMemberNode

TypeConstraintWhereNotSupportsNull

`'T: not null` in `type C<'T when 'T: not null> = class end`

TypeDefn

TypeDefnAbbrevNode

TypeDefnAugmentationNode

TypeDefnDelegateNode

TypeDefnEnumNode

TypeDefnExplicitBodyNode

TypeDefnExplicitNode

TypeDefnRecordNode

TypeDefnRegularNode

TypeDefnUnionNode

TypeFunsNode

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.

TypeHashConstraintNode

Example: `#IDisposable` — a flexible/hash constraint type that matches any subtype.

TypeIntersectionNode

Example: `IFoo & IBar` — an intersection type (F# 9+), combining multiple types with `&` separators.

TypeLongIdentAppNode

Example: `Map SomeAlias` — a long identifier applied to a (possibly generic) type expression, used for type aliases or module-qualified types.

TypeMeasurePowerNode

Example: `m^2` — a measure type raised to a rational power (used in units of measure).

TypeNameNode

TypeOrNode

Example: `A or B` — an F# 9+ type union (disjunction) used in type constraints and signatures.

TypeParenNode

Example: `(int -> string)` — a parenthesised type, used to clarify precedence or wrap a type in parens.

TypeSignatureParameterNode

Example: `?x: int` or `[] name: string` — a parameter type in a signature, optionally with attributes and an identifier label.

TypeStaticConstantExprNode

Example: `const 42` — a static constant expression used as a type argument (e.g. in inline F# code or SRTP).

TypeStaticConstantNamedNode

Example: `N=3` — a named static constant type, pairing an identifier type with a value type (e.g. in SRTP constraints).

TypeStructTupleNode

Example: `struct (int * string)` — a struct tuple type, distinguishable from a reference tuple by the `struct` keyword.

TypeTupleNode

Example: `int * string * bool` — a tuple type. Path interleaves the component types with `*` separators.

TypeWithGlobalConstraintsNode

Example: `'T when 'T : equality` — a type paired with one or more type constraints that apply globally.

UnionCaseNode

UnitNode

UnitOfMeasureNode

ValNode

XmlDocNode

Functions and values

Function or value Description

combineRanges ranges

Full Usage: combineRanges ranges

Parameters:
Returns: range
ranges : range seq
Returns: range

noa n

Full Usage: noa n

Parameters:
    n : 'n option

Returns: Node array
n : 'n option
Returns: Node array

nodeRange n

Full Usage: nodeRange n

Parameters:
Returns: range
n : Node
Returns: range

nodes ns

Full Usage: nodes ns

Parameters:
    ns : 'n seq

Returns: Node seq
ns : 'n seq
Returns: Node seq

Type something to start searching.