resyntax
resyntax copied to clipboard
Suggest `for*/ormap` and `for*/andmap` when appropriate
Resyntax currently refactors this code:
(ormap (lambda (p)
(ormap (lambda (e)
(and (exporting-libraries? e) e))
(part-to-collect p)))
(collect-info-parents ci))
Into this:
(for/or ([p (in-list (collect-info-parents ci))])
(ormap (lambda (e)
(and (exporting-libraries? e) e))
(part-to-collect p)))
Ideally, it should recognize the nested ormap
case and produce this instead:
(for*/or ([p (in-list (collect-info-parents ci))]
[e (in-list (part-to-collect p))])
(and (exporting-libraries? e) e))
Same goes for andmap
.