kind2
kind2 copied to clipboard
Automatic generation of constructors
This PR adds automatic generation of ADT constructors that could not be found by the book loading system.
Two points of discussion remain:
- If an ADT does not type check, it will still (wrongly) generate its constructors and save them into their files, since type checking happens after detection of unbound names. When the ADT is fixed by the user, the previously generated constructor will be bound and thus ignored by the construction generation system, forcing the user to manually delete the old constructors so new ones can be generated. What should be the intended behavior?
- If a constructor is unbound but a file with its name already exists, the file is overwritten by the new constructor. Should we keep this behavior or change it?
Suggestions are welcome!