[Haskell-cafe] AlternativePrelude extension

Malcolm Wallace malcolm.wallace at cs.york.ac.uk
Sat Jan 16 16:40:17 EST 2010


> I'm thinking the syntax would be something like
> AlternativePrelude="MyPrelude".

There is a general principle that the semantics of a program should be  
completely described by the source code itself, and not dependent on  
options that may or may not be specified elsewhere.  Hence, the idea  
of adding {-# LANGUAGE #-} pragmas, so that the source code is self- 
contained.

Specifying {-# LANGUAGE NoImplicitPrelude #-} together with "import  
MyPrelude" satisfies this principle, as does {-# LANGUAGE  
AlternativePrelude="MyPrelude" #-} in all files where it matters.  But  
the difference in usability is slight.

If you are suggesting that {-# LANGUAGE AlternativePrelude="MyPrelude"  
#-} should somehow escape the scope of the module it appears in, then  
I think we heading for less firm ground.

Regards,
     Malcolm



More information about the Haskell-Cafe mailing list