[Yhc] Yhc (and Catch?) bugs

Stefan O'Rear stefanor at cox.net
Mon Aug 6 19:44:02 EDT 2007


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
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : http://www.haskell.org/pipermail/yhc/attachments/20070806/6c544592/attachment.bin


More information about the Yhc mailing list