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
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
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
| 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,
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,
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
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
| 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
> {-# 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 =