egraphs-good / egglog

egraphs + datalog!
https://egraphs-good.github.io/egglog/
MIT License
400 stars 45 forks source link

Fix support for nullary unstable functions #385

Closed saulshanabrook closed 1 month ago

saulshanabrook commented 2 months ago

This resolves #382 by adding parsing support for defining sorts of 0 argument unstable functions.

It does this by handling that input () as the Unit constructor.

If we ever want to remove the Unit constructor, we could move the return type to the list of argument types, to make sure it always has at least one value.

This would also make parsing it more similar to other datatypes.

For now I just kept it the same to make the change minimal.