[Hat] defaulting (was: Program Compiles With GHC 6.6 but not Hat)

Neil Mitchell ndmitchell at gmail.com
Sat Nov 18 16:30:23 EST 2006


Hi

> >    This brings up something that's been niggling me for a while.  Why
> > can Hat not deal with defaulting?  Surely it could be handled by the
> > first stage of hat-trans being inserting explicit type signatures
> > based on the standard defaulting rules?
>
> We made a deliberate design decision that hat-trans should be entirely
> syntax-directed - it does not do type inference.  There are good reasons
> for this decision.

I have a plan to get round this :)

Yhc currently generates Core, which is a nice abstract Haskell like
language, close enough to the original to allow debugging in a
reasonable similar environment. If Yhc.Core was converted to Hat
traced Haskell then you'd get numeric defaulting for free.

It's not perfect, but it might be worth it to get more reliable (but
less accurate) Hat trace generation. I plan to do this sometime soon -
its probably a few hours work at maximum.

Thanks

Neil


More information about the Hat mailing list