[Haskell-cafe] haskell-src-exts Question

Neil Mitchell ndmitchell at gmail.com
Sat Nov 14 11:57:07 EST 2009


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 automatically :-)

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


More information about the Haskell-Cafe mailing list