-
Notifications
You must be signed in to change notification settings - Fork 37
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
Compile regression with Singletons-2.0 #131
Comments
Without looking at this in depth, I think the fact that the code worked in singletons-1.0 is a lucky fluke. Overlapped patterns (like This would be fixed by match flattening (that is, convert overlapping patterns into non-overlapping patterns). This is actually implemented, but is incredibly slow. So slow that many machines would fail to compile |
Actually, you can remove the "otherwise" case (or even the bottom two guards), and the code still works in 1.0 but not 2.0. Is there still overlap somewhere else? |
Hm. Do you have a self-standing test case? I don't have |
|
Unfortunately, this still presents as an overlapping pattern. Consider desugaring guards. We want to write a new sequence of function clauses, without guards, that means the same as an original sequence of function clauses, perhaps with guards. We end up with nested I don't see any good way of avoiding this without match flattening, I'm afraid. |
Okay, if this falls into a known category, that's a good start! |
The following code compiled with singletons-1.0
but fails with singletons-2.0. It seems that the interaction between multiple patterns and guards causes the error:
The following works in both singletons versions:
The text was updated successfully, but these errors were encountered: