Rewrite bootstrap to sorta support type signatures

This commit is contained in:
Reid 'arrdem' McKenzie 2022-06-15 23:01:55 -06:00
parent 56e12252f5
commit 9d03c1425e

View file

@ -208,6 +208,15 @@ class Module(t.NamedTuple):
def __str__(self): def __str__(self):
b = [] b = []
b.append("types:")
for sig, type in self.types.items():
b.append(f" {sig!r}:")
b.append(f" name: {type.name}")
b.append(f" typeconstraints: {type.typeconstraints}")
b.append(f" arms:")
for arm in type.constructors:
b.append(f" - {arm}")
b.append("functions:") b.append("functions:")
for sig, fun in self.functions.items(): for sig, fun in self.functions.items():
b.append(f" {sig!r}:") b.append(f" {sig!r}:")