RE: Haskell Extensions in various compilers (Cabal)

On 13 July 2004 04:15, Isaac Jones wrote:
- Do any of Hugs, GHC, and NHC disallow Long.Hierarchical.Module.Names by default? Can they all turn them off?
GHC includes them by default, and they cannot be turned off. This is a bug (but we're unlikely to fix it). My only comment is that some of the extensions you've formalised are probably a bit too experimental or GHC-specific to be included in the general Extension type. I'd leave out InlinePhase for one. PatternTypeAnnotations should probably be called ScopedTypeVariables. I'm not sure what UnsafeOverlappingInstances does compared with AllowOverlappingInstances and the other instance-related flags. Cheers, Simon

OK So I've made the changes that I got replies about.
hunk ./Distribution/Misc.hs 82
- | RankTwoTypes
+ | RankNTypes
hunk ./Distribution/Misc.hs 85
- | PatternTypeAnnotations
+ | ScopedTypeVariables
hunk ./Distribution/Misc.hs 101
+ | NamedFieldPuns
hunk ./Distribution/Misc.hs 106
- | HoodDebugging
I removed HoodDebugging since it's just a library and not really an
extension in NHC, and since it's not accessable via source code in
Hugs...
"Simon Marlow"
My only comment is that some of the extensions you've formalised are probably a bit too experimental or GHC-specific to be included in the general Extension type. I'd leave out InlinePhase for one. (snip)
I think we'll leave them in; they don't take up much space, and if people use them and they go away, then we can possibly detect when they're build-depending on a particular version of GHC, and output a warning if they're code starts using this deprecated feature. Otherwise, people will just use the "options-ghc" field and we won't be able to notice them. peace, isaac

Oh, also, somehow I didn't see "constructor-less data types" on the list of extensions anywhere. Does this fall under something I'm missing? Should I call it ConstructorlessDataTypes? peace, isaac

On Sun, 25 Jul 2004 23:21:43 -0400, Isaac Jones
Oh, also, somehow I didn't see "constructor-less data types" on the list of extensions anywhere. Does this fall under something I'm missing? Should I call it ConstructorlessDataTypes?
If you mean restricted type synonyms (http://cvs.haskell.org/Hugs/pages/users_guide/restricted-synonyms.html), I think the constructor should be called RestrictedTypeSynonyms. :) /Martin

On Sun, 25 Jul 2004 23:21:43 -0400, Isaac Jones
wrote: Oh, also, somehow I didn't see "constructor-less data types" on the list of extensions anywhere. Does this fall under something I'm missing? Should I call it ConstructorlessDataTypes?
Martin Sjögren
If you mean restricted type synonyms (http://cvs.haskell.org/Hugs/pages/users_guide/restricted-synonyms.html), I think the constructor should be called RestrictedTypeSynonyms. :)
Or, if you mean something like data Dummy a; then how about EmptyDataDecls or VoidDataTypes? Regards, Malcolm P.S. nhc98 permits them by default.

Martin Sjögren
writes: If you mean restricted type synonyms (http://cvs.haskell.org/Hugs/pages/users_guide/restricted-synonyms.html), I think the constructor should be called RestrictedTypeSynonyms. :)
Nope. RestrictedTypeSynonyms is already there.
Malcolm Wallace
Or, if you mean something like data Dummy a; then how about EmptyDataDecls or VoidDataTypes?
Yep, that's what I meant. I'll call them VoidDataTypes. Thanks! peace, isaac

Isaac Jones
Malcolm Wallace
writes: Or, if you mean something like data Dummy a; then how about EmptyDataDecls or VoidDataTypes?
Yep, that's what I meant. I'll call them VoidDataTypes. Thanks!
Oops. I just changed my mind. I'll call them EmptyDataDecls, since I think that's easier to undrestand, even though it's harder to say. FWIW, Malcolm mentioned that it's implemented in nhc98 and can't be turned off. The same seems to be true of Hugs. GHC, OTOH requires -fglasgow-exts. Just for fun, I'll provide the list again here, since this seems to be the complete list of extensions, and how they are implemented by GHC, NHC, and Hugs. peace, isaac data Extension = 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 deriving (Show, Read, Eq) -- |GHC: Return the unsupported extensions, and the flags for the supported extensions extensionsToGHCFlag :: [ Extension ] -> ([Extension], [Opt]) extensionsToGHCFlag l = splitEither $ nub $ map extensionToGHCFlag l where extensionToGHCFlag :: Extension -> Either Extension String extensionToGHCFlag OverlappingInstances = Right "-fallow-overlapping-instances" extensionToGHCFlag TypeSynonymInstances = Right "-fglasgow-exts" extensionToGHCFlag TemplateHaskell = Right "-fth" extensionToGHCFlag ForeignFunctionInterface = Right "-ffi" extensionToGHCFlag NoMonomorphismRestriction = Right "-fno-monomorphism-restriction" extensionToGHCFlag AllowOverlappingInstances = Right "-fallow-overlapping-instances" extensionToGHCFlag AllowUndecidableInstances = Right "-fallow-undecidable-instances" extensionToGHCFlag AllowIncoherentInstances = Right "-fallow-incoherent-instances" extensionToGHCFlag InlinePhase = Right "-finline-phase" extensionToGHCFlag ContextStack = Right "-fcontext-stack" extensionToGHCFlag Arrows = Right "-farrows" extensionToGHCFlag Generics = Right "-fgenerics" extensionToGHCFlag NoImplicitPrelude = Right "-fno-implicit-prelude" extensionToGHCFlag ImplicitParams = Right "-fimplicit-params" extensionToGHCFlag RecursiveDo = Right "-fglasgow-exts" extensionToGHCFlag ParallelListComp = Right "-fglasgow-exts" extensionToGHCFlag MultiParamTypeClasses = Right "-fglasgow-exts" extensionToGHCFlag FunctionalDependencies = Right "-fglasgow-exts" extensionToGHCFlag RankNTypes = Right "-fglasgow-exts" extensionToGHCFlag PolymorphicComponents = Right "-fglasgow-exts" extensionToGHCFlag ExistentialQuantification = Right "-fglasgow-exts" extensionToGHCFlag ScopedTypeVariables = Right "-fglasgow-exts" extensionToGHCFlag FlexibleContexts = Right "-fglasgow-exts" extensionToGHCFlag FlexibleInstances = Right "-fglasgow-exts" extensionToGHCFlag EmptyDataDecls = Right "-fglasgow-exts" extensionToGHCFlag e@ExtensibleRecords = Left e extensionToGHCFlag e@RestrictedTypeSynonyms = Left e extensionToGHCFlag e@HereDocuments = Left e extensionToGHCFlag e@UnsafeOverlappingInstances = Left e extensionToGHCFlag e@NamedFieldPuns = Left e -- |NHC: Return the unsupported extensions, and the flags for the supported extensions extensionsToNHCFlag :: [ Extension ] -> ([Extension], [Opt]) extensionsToNHCFlag l = splitEither $ nub $ map extensionToNHCFlag l where extensionToNHCFlag NoMonomorphismRestriction = Right "" -- not implemented in NHC extensionToNHCFlag ForeignFunctionInterface = Right "" extensionToNHCFlag ExistentialQuantification = Right "" extensionToNHCFlag EmptyDataDecls = Right "" extensionToNHCFlag NamedFieldPuns = Right "-puns" extensionToNHCFlag e = Left e -- |Hugs: Return the unsupported extensions, and the flags for the supported extensions extensionsToHugsFlag :: [ Extension ] -> ([Extension], [Opt]) extensionsToHugsFlag l = splitEither $ nub $ map extensionToHugsFlag l where extensionToHugsFlag OverlappingInstances = Right "+o" extensionToHugsFlag UnsafeOverlappingInstances = Right "+O" extensionToHugsFlag HereDocuments = Right "+H" extensionToHugsFlag RecursiveDo = Right "-98" extensionToHugsFlag ParallelListComp = Right "-98" extensionToHugsFlag MultiParamTypeClasses = Right "-98" extensionToHugsFlag FunctionalDependencies = Right "-98" extensionToHugsFlag RankNTypes = Right "-98" extensionToHugsFlag PolymorphicComponents = Right "-98" extensionToHugsFlag ExistentialQuantification = Right "-98" extensionToHugsFlag ScopedTypeVariables = Right "-98" extensionToHugsFlag ImplicitParams = Right "-98" extensionToHugsFlag ExtensibleRecords = Right "-98" extensionToHugsFlag RestrictedTypeSynonyms = Right "-98" extensionToHugsFlag FlexibleContexts = Right "-98" extensionToHugsFlag FlexibleInstances = Right "-98" extensionToHugsFlag EmptyDataDecls = Right "" extensionToHugsFlag e = Left e
participants (4)
-
Isaac Jones
-
Malcolm Wallace
-
Martin Sjögren
-
Simon Marlow