RE: state of the cabal (preprocessors)

On 25 October 2004 13:57, Malcolm Wallace wrote:
"Simon Marlow"
writes: [Aside: Is there a general agreement that the OPTION pragma should be understood by all Haskell systems, whereas system-specific options are given by pragmas like OPTIONS-GHC, OPTIONS-NHC, etc. or something along those lines?]
I'm happy to switch to using {-# OPTIONS_GHC #-} (or something) if there's consensus. Consider that a vote in favour on behalf of the GHC camp.
Currently I believe ghc uses {-# OPTIONS ... #-} whilst nhc98 uses the pair {-# OPTIONS_COMPILE ... #-} {-# OPTIONS_LINK ... #-} and Hugs has #!runhugs ...
I have no specific preferences for naming, and am happy to change to whatever consensus arrives. However I do think separating out extra link options from the compile-time options could be useful.
Are the link options from each module stored in the .hi file and collected together at link time? GHC doesn't have anything like that. Link-time options have a place in the package-wide Cabal description, too. Options in a source module are good for options which apply to this particular module and no other, whereas link options are more global. I'm not sure that I'd put link options in the source files even if I could. For the compile-time options, how about {-# OPTIONS_{GHC,NHC98,HUGS} ... #-} and we should probably have a compiler-independent way to specify extensions. Hmm, wasn't there a proposal for {-# LANGUAGE #-} at one time? Cheers, Simon

"Simon Marlow"
Are the link options from each module stored in the .hi file and collected together at link time? GHC doesn't have anything like that.
Sadly, no. The link options are recovered from the sources by 'hmake' during ordinary re-compilation dependency analysis, and simply accumulated. (Or at least, that was the plan. It works if you give all the modules in one command-line to nhc98, but I'm not sure if I ever implemented it in hmake.)
Link-time options have a place in the package-wide Cabal description, too.
I'm thinking Cabal (or at least the concept of 'package') is probably the best place for extra link dependencies, not the source code (which may not even exist, if the packages are binary).
For the compile-time options, how about
{-# OPTIONS_{GHC,NHC98,HUGS} ... #-}
I'd be happy enough with that. On the plus side, it is a more regular scheme than currently, and is easily extended to new compilers (should they come along). On the negative, it is an un-forced change, and might break lots of code (although only in a rather trivial way).
and we should probably have a compiler-independent way to specify extensions. Hmm, wasn't there a proposal for {-# LANGUAGE #-} at one time?
I agree this might be nice. Didn't Cabal have some kind of enumeration of language extensions at one time? Regards, Malcolm

Malcolm Wallace writes:
Simon Marlow writes:
and we should probably have a compiler-independent way to specify extensions. Hmm, wasn't there a proposal for {-# LANGUAGE #-} at one time?
I agree this might be nice. Didn't Cabal have some kind of enumeration of language extensions at one time?
It still does, at least according to the infrastructure proposal that's available on the Web. Here's the list of extensions: OverlappingInstances | RecursiveDo | ParallelListComp | MultiParamTypeClasses | NoMonomorphismRestriction | FunctionalDependencies | RankNTypes | PolymorphicComponents | ExistentialQuantification | ScopedTypeVariables | ImplicitParams | FlexibleContexts | FlexibleInstances | EmptyDataDecls | TypeSynonymInstances | TemplateHaskell | ForeignFunctionInterface | AllowOverlappingInstances | AllowUndecidableInstances | AllowIncoherentInstances | InlinePhase | ContextStack | Arrows | Generics | NoImplicitPrelude | NamedFieldPuns | ExtensibleRecords | RestrictedTypeSynonyms | HereDocuments | UnsafeOverlappingInstances /Henrik -- Henrik Nilsson School of Computer Science and Information Technology The University of Nottingham nhn@cs.nott.ac.uk This message has been scanned but we cannot guarantee that it and any attachments are free from viruses or other damaging content: you are advised to perform your own checks. Email communications with the University of Nottingham may be monitored as permitted by UK legislation.

Henrik Nilsson
Malcolm Wallace writes:
Simon Marlow writes:
and we should probably have a compiler-independent way to specify extensions. Hmm, wasn't there a proposal for {-# LANGUAGE #-} at one time?
I agree this might be nice. Didn't Cabal have some kind of enumeration of language extensions at one time?
It still does, at least according to the infrastructure proposal that's available on the Web. Here's the list of extensions:
(snip) It does indeed still use this list of extensions. peace, isaac
participants (4)
-
Henrik Nilsson
-
Isaac Jones
-
Malcolm Wallace
-
Simon Marlow