retrie
retrie copied to clipboard
[discussion] list literal manipulation
:wave: Hi, It would be really useful to be able to manipulate list literals as their cons-list counterparts. I'm guessing this isn't supported because retrie doesn't run the desugarer?
Hi @414owen!
Thank you for your pull request and welcome to our community. We require contributors to sign our Contributor License Agreement, and we don't seem to have you on file.
In order for us to review and merge your code, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA.
If you have received this in error or have any questions, please contact us at [email protected]. Thanks!
Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Facebook open source project. Thanks!
Ah, I understand now, thank you for taking the time to submit the example.
I'm afraid that you are right, retrie doesn't run the desugarer. In fact, it doesn't even run the renamer! I very much wish it did run the renamer at least, but I think the desugarer is probably out of scope since I don't think that it is possible to reconstruct the user program back after desugaring and transforming.
It's possible to build this sort of thing (equivalence between list forms) as a special case, but in general, equivalence in retrie is syntactical modulo alpha-equivalence because we only run the parser.
Thanks for the test case... I'll throw together a patch and we can discuss. We already do something like this for $... I have ideas for generalizing the implementation a bit, but haven't pursued it yet.