Header menu logo F# Compiler Guide

SynPat Type

Represents a syntax tree for an F# pattern

Union cases

Union case Description

Ands(pats, range)

Full Usage: Ands(pats, range)

Parameters:

A conjunctive pattern 'pat1 & pat2'

pats : SynPat list
range : range

ArrayOrList(isArray, elementPats, range)

Full Usage: ArrayOrList(isArray, elementPats, range)

Parameters:
    isArray : bool
    elementPats : SynPat list
    range : range

An array or a list as a pattern

isArray : bool
elementPats : SynPat list
range : range

As(lhsPat, rhsPat, range)

Full Usage: As(lhsPat, rhsPat, range)

Parameters:

A conjunctive pattern 'pat1 as pat2'

lhsPat : SynPat
rhsPat : SynPat
range : range

Attrib(pat, attributes, range)

Full Usage: Attrib(pat, attributes, range)

Parameters:

An attributed pattern, used in argument or declaration position

pat : SynPat
attributes : SynAttributes
range : range

Const(constant, range)

Full Usage: Const(constant, range)

Parameters:

A constant in a pattern

constant : SynConst
range : range

FromParseError(pat, range)

Full Usage: FromParseError(pat, range)

Parameters:

A pattern arising from a parse error

pat : SynPat
range : range

InstanceMember(thisId, memberId, toolingId, accessibility, range)

Full Usage: InstanceMember(thisId, memberId, toolingId, accessibility, range)

Parameters:

Used internally in the type checker

thisId : Ident
memberId : Ident
toolingId : Ident option
accessibility : SynAccess option
range : range

IsInst(pat, range)

Full Usage: IsInst(pat, range)

Parameters:

A type test pattern ':? type '

pat : SynType
range : range

ListCons(lhsPat, rhsPat, range, trivia)

Full Usage: ListCons(lhsPat, rhsPat, range, trivia)

Parameters:

A conjunctive pattern 'pat1 :: pat2'

lhsPat : SynPat
rhsPat : SynPat
range : range
trivia : SynPatListConsTrivia

LongIdent(longDotId, extraId, typarDecls, argPats, accessibility, range)

Full Usage: LongIdent(longDotId, extraId, typarDecls, argPats, accessibility, range)

Parameters:

A long identifier pattern possibly with argument patterns

longDotId : SynLongIdent
extraId : Ident option
typarDecls : SynValTyparDecls option
argPats : SynArgPats
accessibility : SynAccess option
range : range

Named(ident, isThisVal, accessibility, range)

Full Usage: Named(ident, isThisVal, accessibility, range)

Parameters:

A name pattern 'ident'

ident : SynIdent
isThisVal : bool
accessibility : SynAccess option
range : range

Null range

Full Usage: Null range

Parameters:

The 'null' pattern

range : range

OptionalVal(ident, range)

Full Usage: OptionalVal(ident, range)

Parameters:

'?id' -- for optional argument names

ident : Ident
range : range

Or(lhsPat, rhsPat, range, trivia)

Full Usage: Or(lhsPat, rhsPat, range, trivia)

Parameters:

A disjunctive pattern 'pat1 | pat2'

lhsPat : SynPat
rhsPat : SynPat
range : range
trivia : SynPatOrTrivia

Paren(pat, range)

Full Usage: Paren(pat, range)

Parameters:

A parenthesized pattern

pat : SynPat
range : range

QuoteExpr(expr, range)

Full Usage: QuoteExpr(expr, range)

Parameters:

<@ expr @>, used for active pattern arguments

expr : SynExpr
range : range

Record(fieldPats, range)

Full Usage: Record(fieldPats, range)

Parameters:

A record pattern

fieldPats : ((LongIdent * Ident) * range option * SynPat) list
range : range

Tuple(isStruct, elementPats, commaRanges, range)

Full Usage: Tuple(isStruct, elementPats, commaRanges, range)

Parameters:
    isStruct : bool
    elementPats : SynPat list
    commaRanges : range list
    range : range

A tuple pattern

isStruct : bool
elementPats : SynPat list
commaRanges : range list
range : range

Typed(pat, targetType, range)

Full Usage: Typed(pat, targetType, range)

Parameters:

A typed pattern 'pat : type'

pat : SynPat
targetType : SynType
range : range

Wild range

Full Usage: Wild range

Parameters:

A wildcard '_' in a pattern

range : range

Instance members

Instance member Description

this.IsAnds

Full Usage: this.IsAnds

Returns: bool
Returns: bool

this.IsArrayOrList

Full Usage: this.IsArrayOrList

Returns: bool
Returns: bool

this.IsAs

Full Usage: this.IsAs

Returns: bool
Returns: bool

this.IsAttrib

Full Usage: this.IsAttrib

Returns: bool
Returns: bool

this.IsConst

Full Usage: this.IsConst

Returns: bool
Returns: bool

this.IsFromParseError

Full Usage: this.IsFromParseError

Returns: bool
Returns: bool

this.IsInstanceMember

Full Usage: this.IsInstanceMember

Returns: bool
Returns: bool

this.IsIsInst

Full Usage: this.IsIsInst

Returns: bool
Returns: bool

this.IsListCons

Full Usage: this.IsListCons

Returns: bool
Returns: bool

this.IsLongIdent

Full Usage: this.IsLongIdent

Returns: bool
Returns: bool

this.IsNamed

Full Usage: this.IsNamed

Returns: bool
Returns: bool

this.IsNull

Full Usage: this.IsNull

Returns: bool
Returns: bool

this.IsOptionalVal

Full Usage: this.IsOptionalVal

Returns: bool
Returns: bool

this.IsOr

Full Usage: this.IsOr

Returns: bool
Returns: bool

this.IsParen

Full Usage: this.IsParen

Returns: bool
Returns: bool

this.IsQuoteExpr

Full Usage: this.IsQuoteExpr

Returns: bool
Returns: bool

this.IsRecord

Full Usage: this.IsRecord

Returns: bool
Returns: bool

this.IsTuple

Full Usage: this.IsTuple

Returns: bool
Returns: bool

this.IsTyped

Full Usage: this.IsTyped

Returns: bool
Returns: bool

this.IsWild

Full Usage: this.IsWild

Returns: bool
Returns: bool

this.Range

Full Usage: this.Range

Returns: range

Gets the syntax range of this construct

Returns: range

Type something to start searching.