On Tue, Aug 07, 2007 at 12:30:20AM +0100, Neil Mitchell wrote:
> > But none of that is necessary for the basic hack - IS IT POSSIBLE? (even
> > if so, is it too hacky? I believe Jhc *always* implicitly imports
> > something like Jhc.Prelude that contains definitions of [] and a few
> > other things, in addition to the standard Prelude stuff, and that feels
> > *right*, to me)
> 
> We came to the decision that the right thing is to always import
> qualified Prelude, regardless of if the user does import Prelude(),
> then always bind to fully qualified names. This is the solution we
> tried, and we failed completely.
> 
> Thanks

I don't know if it's even remotely possible to implement something of
this scale in modern nyhc by anyone but Röjemo, but the scheme I've
settled on in my Haskell compiler project is to:

1. Create a special module QhcPrimitives containing the tuples, etc

2. In every module, do the equivalent of "import qualified QhcPrimitives
   as $QhcPrimitives"

3. Bind special syntax to $QhcPrimitives.(,,,), etc

I *believe* this implements the H98 rules exactly, and seems a bit
simpler since it doesn't involve checking for Prelude imports and the
like.

Stefan

Attachment: signature.asc
Description: Digital signature

_______________________________________________
Yhc mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/yhc

Reply via email to