Skip to content

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 + y

Constructors

Constructor

new Equation(patterns, body, returnExpr?, loc?): Equation

Parameters

ParameterType
patternsPattern[]
bodyUnguardedBody | GuardedBody[]
returnExpr?Return
loc?SourceLocation

Returns

Equation

Overrides

ASTNode.constructor

Methods

getMetadata()

getMetadata<T>(key): T

Type Parameters

Type Parameter
T

Parameters

ParameterType
keystring

Returns

T

Inherited from

ASTNode.getMetadata


hasMetadata()

hasMetadata(key): boolean

Parameters

ParameterType
keystring

Returns

boolean

Inherited from

ASTNode.hasMetadata


setMetadata()

setMetadata(key, value): void

Parameters

ParameterType
keystring
valueany

Returns

void

Inherited from

ASTNode.setMetadata