Even if this approach turns out to be bad for some reason I'm hoping that the unit tests will be valuable as documentation to those following: http://github.com/akkartik/wart/blob/0a3e09/002parenthesize....