[Yhc] Some more changes to core

Tom Shackell shackell at cs.york.ac.uk
Sun Aug 5 06:32:22 EDT 2007


Neil Mitchell wrote:

> Hmm, now I'm changing my mind. Those examples make me think that ; is
> more sensible - since otherwise you are really screwing with small
> differences in what makes an operator or not - I especially dislike
> the "leading digits" rule. I would rather that Core didn't care too
> much about operator vs function differences, but these two examples
> show it will have to. Therefore I think ; makes more sense.

Okay. As a little side note, you won't believe how nhc98 stores local 
functions (which I've just discovered)

    module Foo

    foo = ..
      where bar = ...

The name Foo.Foo.Prelude.200.bar is actually stored in nhc98 as an 
instance dictionary!

     - defined in the module Foo
     - on the datatype Prelude.200, i.e. the two hundred tuple!?!
     - to the class(!?) Foo.Foo.bar

Yes, really. Thus currently my code encodes the name as

    Foo;Prelude.(,,,,, ... ,,,,,,,,);Foo.Foo.bar

The fiddly bit is going to be deciding that this isn't an instance 
dictionary but is actually a locally defined function ... *sigh*

> If we use ; we can also change it so:
> 
> module Foo where
> 
> foo = ...
>    where bar = ...
> 
> Foo;foo.bar - which is exactly what you would want, to keep as much
> info as possible.
 >
 > Of course, this change could be done sometime in the future.

Yes this would be ideal, but unfortunately it would involve some 
extensive changes as currently nhc98 doesn't store that much information 
about what a function was defined inside.

Cheers :-)


Tom


More information about the Yhc mailing list