Re: DynFlags.lhs

Simon Marlow <[email protected]>
Newsgroups gmane.comp.lang.haskell.cvs.ghc
Message-ID <[email protected]>
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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.