Class: Equation
Represents one Equation with its arguments and body. Allows for overloading and pattern matching. You may define the return statement to access it more easily.
Example
ts
add 0 y = y
add x y = x + yConstructors
Constructor
new Equation(
patterns,body,returnExpr?,loc?):Equation
Parameters
| Parameter | Type |
|---|---|
patterns | Pattern[] |
body | UnguardedBody | GuardedBody[] |
returnExpr? | Return |
loc? | SourceLocation |
Returns
Equation
Overrides
ASTNode.constructor
Methods
getMetadata()
getMetadata<
T>(key):T
Type Parameters
| Type Parameter |
|---|
T |
Parameters
| Parameter | Type |
|---|---|
key | string |
Returns
T
Inherited from
ASTNode.getMetadata
hasMetadata()
hasMetadata(
key):boolean
Parameters
| Parameter | Type |
|---|---|
key | string |
Returns
boolean
Inherited from
ASTNode.hasMetadata
setMetadata()
setMetadata(
key,value):void
Parameters
| Parameter | Type |
|---|---|
key | string |
value | any |
Returns
void
Inherited from
ASTNode.setMetadata