19 lines
303 B
Python
19 lines
303 B
Python
import dataclasses
|
|
import fractions
|
|
|
|
from parser import Atom
|
|
from typesystem import Type
|
|
|
|
@dataclasses.dataclass
|
|
class Literal:
|
|
value: int | fractions.Fraction
|
|
|
|
@dataclasses.dataclass
|
|
class Application:
|
|
op: str
|
|
inputs: [int]
|
|
|
|
@dataclasses.dataclass
|
|
class Node:
|
|
value: Application | Atom
|
|
type: Type
|