-
Notifications
You must be signed in to change notification settings - Fork 38
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
General Recursion #30
Comments
Here is a gist from Andras: https://gist.github.com/AndrasKovacs/6b1270d9edb702641f42fd6440f0f750
I think you can then implement letrec as sugar over let and fix, but you'll have to figure out a way to make the type annotation in there.
If you want to have datatypes with induction then a pretty minimal setup is (I'm assuming consistency is not important):
with computation rule:
If you want indexed datatypes you have to add a native identity type and "upgrade" the fixpoint to:
You can even get indexed inductive-recursive types, with the following fixpoint:
If you want efficiency and/or consistency, things become more complicated... |
Can you explain what the |
It's a type where the |
Another way is to add
With computation rule:
For some Either type, for example if you have sigma and booleans:
|
What would it look like to add on general recursion? What would typing letrec look like (I'm assuming it would be letrec)? Are there specific designs you already had in mind?
Adding general recursion was mentioned as a possible future update here #7 (comment)
The text was updated successfully, but these errors were encountered: