Class: ConstructorPattern
Represents a pattern matching a specific data constructor.
Example
ts
safeDiv (Just x) y = x / yExtends
ArgsPattern
Constructors
Constructor
new ConstructorPattern(
symbol,args,loc?):ConstructorPattern
Parameters
| Parameter | Type |
|---|---|
symbol | SymbolPrimitive |
args | Pattern[] |
loc? | SourceLocation |
Returns
ConstructorPattern
Overrides
ArgsPattern.constructor
Accessors
jsonType
Get Signature
get
protectedjsonType():ArgsPatternKind
Returns
ArgsPatternKind
Overrides
ArgsPattern.jsonType
Methods
dispatchVisit()
protecteddispatchVisit<R>(visitor,callback?):R
Type Parameters
| Type Parameter |
|---|
R |
Parameters
| Parameter | Type |
|---|---|
visitor | Visitor<R> |
callback? | (node) => R |
Returns
R
Inherited from
ArgsPattern.dispatchVisit
getMetadata()
getMetadata<
T>(key):T|undefined
Type Parameters
| Type Parameter |
|---|
T |
Parameters
| Parameter | Type |
|---|---|
key | string |
Returns
T | undefined
Inherited from
ArgsPattern.getMetadata
hasMetadata()
hasMetadata(
key):boolean
Parameters
| Parameter | Type |
|---|---|
key | string |
Returns
boolean
Inherited from
ArgsPattern.hasMetadata
is()
is<
T>(nodeType):this is T
Type Parameters
| Type Parameter |
|---|
T extends ASTNode |
Parameters
| Parameter | Type |
|---|---|
nodeType | (...args) => T |
Returns
this is T
Inherited from
ArgsPattern.is
setMetadata()
setMetadata(
key,value):void
Parameters
| Parameter | Type |
|---|---|
key | string |
value | any |
Returns
void
Inherited from
ArgsPattern.setMetadata
toString()
toString():
string
Returns
string
Overrides
ArgsPattern.toString
[hasInstance]()
static[hasInstance](instance):boolean
Parameters
| Parameter | Type |
|---|---|
instance | any |
Returns
boolean
Inherited from
ArgsPattern.[hasInstance]