facebookincubator / retrie

Retrie is a powerful, easy-to-use codemodding tool for Haskell.
MIT License
502 stars 30 forks source link

Parentheses around sections are not preserved in `--adhoc 'forall a. a . id = a'` #35

Closed watashi closed 5 months ago

watashi commented 3 years ago

Parentheses around sections are not preserved in some rewrites, this leads to invalid code produced by retrie. To repro:

$ cat main.hs
main = let f = (+1) . id in print $ f 1
$ runghc main.hs
2
$ retrie --adhoc 'forall a. a . id = a'
$ runghc main.hs

main.hs:1:16: error: parse error on input ‘+’
  |
1 | main = let f = +1 in print $ f 1
  |                ^
xich commented 3 years ago

This is similar to #34. I'll look into it too.

Aside: is there some permission I need to this repo now so I can do things like assign issues to myself, etc?

watashi commented 3 years ago

Aside: is there some permission I need to this repo now so I can do things like assign issues to myself, etc?

I think I can add you as an "External Contributor" with write permission (not sure if this affects sync) or triage permission. You need sign the CLA first so I can do that in oss tool though :-)

xich commented 3 years ago

You need sign the CLA first so I can do that in oss tool though :-)

Hahahahahahahahahhaha. Done.