-
Notifications
You must be signed in to change notification settings - Fork 51
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Mutually recursive datatypes #397
Comments
FWIW in the Python bindings mutually recursive data types are supported through late binding type annotations. All classes/datatypes are translated to plain sort definitions & functions. |
One advantage of this proposal is that it would still allow mutually recursive data types even if we made datatype closed, instead of open as it is now |
Thought: Could make all types "lazy", that would support recursive data.... With the current syntax, then we just defer processing until it's defined. |
This was fixed in #432 |
Currently, datatypes cannot be mutually recursive. For example, the following is not allowed
OCaml supports mutually recursive type with the
type ... and ...
keyword. We can probably do something similar:Or
Or
Or (Jul 25 updates: we are more in favor of this syntax)
Or maybe there is a better syntax for this?
Another pattern we commonly have (but is not supported) is
Our recursive datatypes should also have a good support for this.
The text was updated successfully, but these errors were encountered: