14 Nov 17:57
Re: haskell-src-exts Question
Neil Mitchell <ndmitchell <at> gmail.com>
2009-11-14 16:57:07 GMT
2009-11-14 16:57:07 GMT
Hi Daniel, > Funny, I did the opposite approach the other day (not saying either is better > :)); that is: parenthesize everything while building the AST (with a wrapper > for App) and then: I have utilities in HLint for that too - but I don't want to remove users brackets automaticallyBtw, if you use uniplate you might find your code goes faster, and is simpler: deparenthesize :: (Data a) => a -> a deparenthesize = transformBi goT . transformBi goT where (the rest exactly as before, but skipping isString) I always use Uniplate when working with HSE - they go great together (do import Data.Generics.PlateData, and you don't need any extra instances or anything) Thanks, Neil
Btw, if you use uniplate you might find your code goes faster, and is simpler:
deparenthesize :: (Data a) => a -> a
deparenthesize = transformBi goT . transformBi goT
where
(the rest exactly as before, but skipping isString)
I always use Uniplate when working with HSE - they go great together
(do import Data.Generics.PlateData, and you don't need any extra
instances or anything)
Thanks, Neil
RSS Feed