jackfirth / resyntax

A Racket refactoring engine
Apache License 2.0
51 stars 10 forks source link

Suggest map => for/list, similar to for-each => for #193

Open cloudrac3r opened 1 year ago

cloudrac3r commented 1 year ago

Just like the for-each => for conversion, some maps should be converted to for/list.

They can use the same heuristics to detect whether they should be converted (i.e. having a large enough body)

Previously discussed here: https://github.com/racket/drracket/pull/611#discussion_r1131935922

jackfirth commented 11 months ago

Found another instance where this would help: in this code after replacing the (apply append (for/list ...)) with a single (for*/list ...), the map can be fused into that for*/list.