-
Notifications
You must be signed in to change notification settings - Fork 8
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
Pattern matching variables get renamed in RULES on 'case' #179
Comments
I was able to do this manually with
The I'm not sure how I would generalize this so that I could put it into something like a This also does sort of seem to suggest that there could be a combinator added that temporarily gives a name to a monomorphized function (without needing to worry about the specifics of what it is monomorphized to) in order to perform a transformation like this. |
Have you tried using I think we should kill the variants that take a name. This was mean to make them targetable, but we have better ways to do that. Something like:
|
@xich Thanks, that works with |
Yeah, focus is a bit of a mess. There isn't a variant with the right type ( You might be able to get away with |
(or add another variant of This is where a monomorphic scripting language bites us hard. |
@xich It works with |
Actually, I may have spoken too soon... That doesn't seem to work with |
Hmm, would it make sense to have variants of KURE commands that use |
Ahhh, it looks like |
You suggested getting rid of the variants that take names which makes sense, but is there currently a way to say something like "apply case-float-lemma ... to all applications of 'abs'"? Sometimes it picks the "wrong" application of |
I notice that if I have
and I fire the rule, it will rename the variables in the match to
a
andb
, but it doesn't perform the corresponding substitution in the body (abs x
), leading to references to nonexistent names. Is it possible to avoid this problem? I have tried using_
s instead ofa
andb
, but it seems to run into the same problem (except that the specific names used are generated by GHC).If not, is there another way to implement this sort of floating transformation that specifically targets a certain function (in this case
abs
)? I notice that there iscase-float-arg
andcase-float-arg-unsafe
. I have triedcase-float-arg-unsafe [| abs |]
on the nodeabs <type and dictionary arguments> (case ds pf wild (,) x y -> ...
, but it saysI imagine this is because I am giving it
[| abs |]
instead of[| (abs <type and dictionary arguments>) |]
. If that's the case, is there a good way to provide it with the appropriate arguments (or avoid the issue altogether)? Ideally, I would like it to apply regardless of the specific type and dictionary arguments.The text was updated successfully, but these errors were encountered: