DynFlags.lhs

Simon Marlow marlowsd at gmail.com
Thu Sep 20 11:27:05 CEST 2012


On 19/09/2012 20:01, Ian Lynagh wrote:
> On Wed, Sep 19, 2012 at 07:28:23AM +0000, Simon Peyton-Jones wrote:
>> |  > Somehow compiling DynFlags.lhs has started taking a very long time, and
>> |  generates lots of code. I have not had time to investigate, but if anyone has any
>> |  idea what is happening I'd be happy to know.
>> |
>> |  I've added some more stuff to it recently. In particular, a large type:
>> |      includes/dist-derivedconstants/header/GHCConstantsHaskellType.hs
>
> It's mostly the Read instance, but partly the Show instance, of the
> type. I've attached a simple example with just a Read instance;
> compiling with
>      ghc -O -c W2.hs
> takes a while.

Instead of using Read/Show, you could generate some code in 
mkDerivedConstants to use ReadP and Outputable, which should be much 
smaller and faster.

Cheers,
	Simon




More information about the Cvs-ghc mailing list