Re: Pragma not recognised when wrapped in #ifdef

2009-02-11 Thread Duncan Coutts
On Tue, 2009-02-10 at 13:43 +, Simon Marlow wrote: > Simon Peyton-Jones wrote: > > I'm guessing a bit here, but it looks as if you intend this: > > > > * GHC should read Foo.hs, and see {-# LANGUAGE CPP #-} > > * Then it should run cpp > > * Then it should look *again* in the result of running

Re: Pragma not recognised when wrapped in #ifdef

2009-02-11 Thread Neil Mitchell
Hi > Is there still a need for CPP now that Template Haskell exists? Yes. For a start you might need CPP to switch between Haskell compilers that do and don't support Template Haskell! Both technologies do different things, CPP is great for conditional compilation based on compiler version/featur

Re: Pragma not recognised when wrapped in #ifdef

2009-02-11 Thread Colin Adams
Is there still a need for CPP now that Template Haskell exists? 2009/2/11 Simon Peyton-Jones : > | Perhaps CPP shouldn't be a pragma, just a command-line flag? It seems > | to be the only one that affects/involves preprocessor(s). AFAICT, the > | others all affect the haskell compiler stage. > > Y

RE: Pragma not recognised when wrapped in #ifdef

2009-02-11 Thread Simon Peyton-Jones
| Perhaps CPP shouldn't be a pragma, just a command-line flag? It seems | to be the only one that affects/involves preprocessor(s). AFAICT, the | others all affect the haskell compiler stage. Yes, it does seem anomalous. I suppose the motivation is that some modules might need CPP and some not,

Re: Pragma not recognised when wrapped in #ifdef

2009-02-10 Thread Brandon S. Allbery KF8NH
On 2009 Feb 10, at 8:55, Alistair Bayley wrote: Perhaps CPP shouldn't be a pragma, just a command-line flag? It seems to be the only one that affects/involves preprocessor(s). AFAICT, the others all affect the haskell compiler stage. Or require the CPP pragma to be the first thing in the file,

Re: Pragma not recognised when wrapped in #ifdef

2009-02-10 Thread Alistair Bayley
2009/2/10 Simon Peyton-Jones : > I'm guessing a bit here, but it looks as if you intend this: > > * GHC should read Foo.hs, and see {-# LANGUAGE CPP #-} > * Then it should run cpp > * Then it should look *again* in the result of running cpp, > to see the now-revealed {-# LANGUAGE DeriveDataTypeabl

Re: Pragma not recognised when wrapped in #ifdef

2009-02-10 Thread Simon Marlow
Simon | -Original Message- | From: glasgow-haskell-users-boun...@haskell.org [mailto:glasgow-haskell-users- | boun...@haskell.org] On Behalf Of Alistair Bayley | Sent: Tuesday, February 10, 2009 12:03 PM | To: GHC Users Mailing List | Subject: Re: Pragma not recognised when wrapped in

RE: Pragma not recognised when wrapped in #ifdef

2009-02-10 Thread Simon Peyton-Jones
| Subject: Re: Pragma not recognised when wrapped in #ifdef | | > {-# LANGUAGE CPP #-} | > #ifdef PRAGMA_DERIVE_TYPEABLE | > {-# LANGUAGE DeriveDataTypeable #-} | > #else | > {-# OPTIONS -fglasgow-exts #-} | > #endif | > -- This file is Test/Fail.hs. | > -- ghc --make -optP-D

Re: Pragma not recognised when wrapped in #ifdef

2009-02-10 Thread Alistair Bayley
> {-# LANGUAGE CPP #-} > #ifdef PRAGMA_DERIVE_TYPEABLE > {-# LANGUAGE DeriveDataTypeable #-} > #else > {-# OPTIONS -fglasgow-exts #-} > #endif > -- This file is Test/Fail.hs. > -- ghc --make -optP-DPRAGMA_DERIVE_TYPEABLE -XCPP Test.Fail > module Test.Fail where > import Data.Generics > data Fail =