simonmar at microsoft.com
Mon Sep 6 06:17:26 EDT 2004
On 06 September 2004 11:11, MR K P SCHUPKE wrote:
> Would it cause me any problems if I added "deriving Show" to all the
> types in compiler/hsSyn? (Can't think of a problem here... is there
> any reason why this is not done by default? - It is really handy if
> trying to pattern match on code syntax to be able to see what
> abstract syntax is generated by certain code)
You'll probably have to derive Show for a *lot* of types, right down to
FastString (and in fact deriving Show won't work there, you'll have to
write an instance yourself, but it shouldn't be too hard).
I guess we don't use Show because it would (a) bloat the compiler a lot,
and (b) slow down compiles, and in any case most of the time we want ppr
instead. The Show output is going to be pretty hard to read.
More information about the Glasgow-haskell-users