I hadn't looked at Copilot Labs in a while but they have an interesting new feature they call "Brushes" that has Copilot rewrite highlighted code for different purposes ("Clean", "Fix Bug", "Readable", "Add Types", "Document", etc.). Here's a couple rounds of "Clean" on isEven:

Dec 9, 2022 · 3:28 AM UTC

Replying to @moyix
isEven(num)=return !(num&1) is correct in 2's complement for positive and negative numbers; the recursive function won't terminate for negative numbers. Sigh.
Exactly, it made it better! The bad recursive one was the starting point.
Replying to @moyix
can it write docstrings?
It's awesome! Looking forward to playing with the "Custom Brush" feature soon :)
Replying to @moyix
For the love of god will someone teach copilot about mod
Ha, it suggests the n % 2 == 0 solution if you just write the isEven prototype; this was just to give it some bad code to clean up.
Replying to @moyix @Wattenberger
So awesome!!! Love it.
Replying to @moyix
Maybe we can use those different versions of one func for validating the correctness of it.