-
Notifications
You must be signed in to change notification settings - Fork 23
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
Make count and enumerate work for user-defined recursive types #175
Comments
Actually, should be easy now with the enumeration library! |
This seems important to be able to do things like define recursive trees and enumerate or count them. |
Note that at the moment we can actually make Disco crash:
|
See https://github.com/disco-lang/disco/blob/474384f5682dcd2b94f0aae1a58c578f1639c6df/src/Disco/Enumerate.hs . The obvious thing we need to do is extend the
In any case, the idea would be build a lazy map from type names to enumerations; when we see a name that is already in the map we can stick an |
Original comment: Have to extend count and enumerate to take the context of type definitions. Count has to do some kind of least fixed point computation, or a Jacobian matrix or something like that...
Using the
enumeration
library, and the fact that we should no longer support enumeration of infinite types (because lists are strict and hence finite), this should not be too bad. See also #309 and #347.The text was updated successfully, but these errors were encountered: