Haskell 2010 libraries

wren ng thornton wren at community.haskell.org
Sun May 9 01:21:38 EDT 2010

Brandon S. Allbery KF8NH wrote:
> On May 4, 2010, at 05:09 , Duncan Coutts wrote:
>> On Fri, 2010-04-30 at 10:42 +0100, Simon Marlow wrote:
>>> Bear in mind these goals: we want to
>>>   a. support writing code that is Haskell 2010 only: it only uses
>>>      Haskell 2010 language features and modules.
>>>   b. not break existing code as far as possible
> I'm going to dissent here:  current code assumes extensions, not a 
> standard.  I think it's not outside the pale to have code that wishes to 
> conform to Haskell2010 be modified to do so, and otherwise the code 
> continues to be "extended nonstandard Haskell" if it is not already 
> Haskell98-conformant.  After all, Haskell2010 doesn't quite include 
> *all* of the extensions that are in common use.
> So, I'm going to go out on a limb here and suggest that Haskell 2010 
> code should specify
>  > {-# LANGUAGE Haskell2010 #-}
> to distinguish from Haskell '98 code (no LANGUAGE pragmas) and extension 
> code (other LANGUAGE pragmas).  Users who wish to combine the above with 
> nonstandard extensions can expect to do extra work.  Existing code 
> continues to work because it doesn't explicitly limit itself to 
> Haskell2010.

I haven't had time to fully consider how the libraries should be 
handled, but I'm all for this suggestion. Especially once the Haskell 
report becomes a rolling target with yearly updates, explicitly 
declaring which version of the standard the designer had in mind should 
help to fend off bit-rot. In the short term the report changes will be 
minor enough as not to cause issues, but I'm thinking more about five 
and ten years out when people come back to look at classic projects 
(e.g., the future equivalents of THIH, SOE,...)

Even aside from the LANGUAGE pragma, I agree that there is a difference 
between current code written in various flavors of GHC 20XX, vs code 
that intends to be H2010 conformant. We shouldn't break GHC20XX code 
needlessly, but I don't think we should try to enshrine it as 
proto-H2010 either. H2010 code should state that it is H2010 code. And 
code that wants to be considered H2010 plus extensions (rather than H98 
plus extensions) should say so too.

Live well,

More information about the Libraries mailing list