[Haskell-cafe] Re: [Haskell] ANNOUNCE: Haskell 2010 Report (final)

John Meacham john at repetae.net
Tue Jul 13 22:36:38 EDT 2010


On Tue, Jul 13, 2010 at 10:24:00AM +0100, Simon Marlow wrote:
>> Well, a main useful case is that I can do -phaskell98 and -phaskell2010
>> at the same time. So I can make the default jhc behavior be the union of
>> the two languages easily.
>
> That works in GHC too: the modules of those two packages don't overlap.  
> That is partly because we never moved Prelude from base to haskell98.

But don't you still have to have things directly declare they depend on
'base' then in order to get 'Prelude'? The extra dependency on the
implementation specific 'base' because you want both haskell98 and
haskell2010 is what I am trying to avoid.

> But suppose the Haskell 2010 Prelude had some differences from the  
> Haskell 98 Prelude - then a direct re-export wouldn't work, and you'd be  
> stuck with conflicts again.  So my main point is that while direct  
> re-exports avoid conflicts sometimes, they're not a general solution,  
> and eventually you run into the same problems again.  There are  
> differences between several Haskell 2010 modules and the equivalent base  
> modules, so you won't be able to use re-exports for those.

Yeah, jhc really doesn't have a good solution for that. 

Something I was thinking about was 'union' modules, like, if you include
two libraries that both export Data.List, you get the union of both of
what they export with conflicts being reported lazily (though, instance
conflicts will likely have to be reported strictly). It may help in some
cases, but again, is not a general solution. (and I can imagine it would
be confusing if it happened when people wern't expecting it...)

>> Hmm.. maybe. Jhc doesn't have PackageImports, the idea being that you
>> re-export modules rather than importing them from a specific package and
>> exporting their interface.  So, it sort of shifts the effort from the
> > interface makers to the implementors, as in, the Haskell 98 Prelude
> > will actually have to be in a module called Compat.Haskell98.Prelude
> > and just re-exported by the 'haskell98' and 'haskell2010' modules.
>
> I don't think the difference is as fundamental as you make out.  In  
> Haskell you can already write

Yeah, I don't think they are really that different in capabilities.
Though, Jhc currently has a restriction that module names (real modules,
not re-exported ones) cannot ever conflict, even if hidden, so there is
a big difference in expressibility at the moment, but that is mainly due
to what I consider a bug in jhc, or a misfeature at best.

        John

-- 
John Meacham - ⑆repetae.net⑆john⑈ - http://notanumber.net/


More information about the Haskell-Cafe mailing list