We already have this for type errors; we need a similar functionality for runtime errors so that we can standardize and consolidate error reporting. This can be implemented by:
- adding a data type with all of the error cases (see Error/TypeError.hs)
- these cases should be based off of what appears in Runtime/Eval.hs
- adding a constructor to
Err in Error/Error.hs
- creating an
Error smart constructor to assign ids (see Error/Error.hs)
- creating helper functions to report these errors in in the evaluation monad in Runtime/Monad.hs (see Typechecker/Monad.hs)
Once this is done, the existing runtime errors that are manually written in Runtime/Eval.hs should be replaced with instances of the helper functions.
We can then use this infrastructure to reclassify, reword, extend or otherwise edit the existing errors, likely with the feedback of instructors and users. That is a separate issue, however.
We already have this for type errors; we need a similar functionality for runtime errors so that we can standardize and consolidate error reporting. This can be implemented by:
Errin Error/Error.hsErrorsmart constructor to assign ids (see Error/Error.hs)Once this is done, the existing runtime errors that are manually written in Runtime/Eval.hs should be replaced with instances of the helper functions.
We can then use this infrastructure to reclassify, reword, extend or otherwise edit the existing errors, likely with the feedback of instructors and users. That is a separate issue, however.