jackfirth / resyntax

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

Rewrite `predicate/c` to `(-> any/c boolean?)` #191

Open jackfirth opened 1 year ago

jackfirth commented 1 year ago

Resyntax currently rewrites (-> any/c boolean?) to predicate/c. This was based on my understanding that predicate/c offers improved performance over (-> any/c boolean?) for struct predicates. But that's not the case, -> is smart enough to include the same optimizations that predicate/c provides. The -> form is more readable than predicate/c, and predicate/c is basically obsolete. Resyntax should suggest just writing (-> any/c boolean?) instead of predicate/c. See this discussion for more context.