anoma / geb

A Categorical View of Computation
https://anoma.github.io/geb/
GNU General Public License v3.0
28 stars 10 forks source link

Error Node And Maybe Compilation Wrapper #129

Closed agureev closed 1 year ago

agureev commented 1 year ago

Adds an error node to the STLC class with possibility to be of an arbitrary type specified by the user. Appropriate helper functions added, such as errorp. Given that a term fed into the compiler now has an error subterm, it will be compiled thorough a Maybe monad as specified by to-cat-err otherwise compiling as usual without waste of computational resources.

Adds test cases for casing compilation to Geb to showcase how the interpreter can help with evaluating errors and where they appear in the STLC code.

This solves issue #90 but further improvements need to be had