Core libs summary

Alastair David Reid reid@cs.utah.edu
29 Jun 2001 15:06:18 -0600


Malcolm:
> I love it when people say "you just need to hack the type system a
> little bit".  :-)

The original runST implementation (i.e., hardwire it into the
typechecker) really is pretty simple.  I think even I could do it (to
Hugs) and I avoided ever doing anything with Hugs' typechecker the
whole time I maintained it.

Alastair:
>> The spec should make it clear that the (slightly) more restrictive
>> runST implementation is cool.

Malcolm:
> Which of the two implementations is the more restrictive?

Hmmm, that was a bit ambiguous wasn't it?
I meant the one where you hardwire runST into the typechecker.

Simon:
>> Perhaps we could make 'instance Bits Integer' optional, because
>> that's probably the hardest bit.

Malcolm:
> Blink.  What exactly would such an instance mean?

1) Transform the Integer arguments into infinite streams of bits (sign
   extending as necessary)

2) Perform the operation in the obvious way

3) Transform Integer parts of the result back into a finite Integer operation.

Employ the obvious tricks to avoid requiring infinite space and time.


It helps if your Integer representation is based on binary numbers.

It really sucks if your Integer representation is based on decimals
 (as in Hugs).

Malcolm:
> Ah, but we don't have Exceptions.  As a point of interest, is there
> a good reason why the Exception type needs to be in the Prelude?

Because it's nice to unify IOError with Exception as in GHC (but not Hugs).

And because you want to define error by something like:

  error msg = Exception.raise (Exception.Error msg)

(adapting names to match Exception's export list as required).

Avoiding this unification is a bit awkward.

Avoiding this unification and implementing cooperative threads a la Hugs
 is unbelievably awkward.

Malcolm:
> 			NHC vs Nhc

Is NHC/Nhc (used as) an acronym?

Elsewhere in the library we are keeping acronyms all caps (and I think
that's the right thing to do).

GHC is used as a (mildly anachronistic) acronym so I'd expect it 
to be all caps.

Hugs can be explained as an acronym too but it's not used that way.

Just to confuse things, I also don't think of HGL as an acronym since
the H can stand for at least 3 different things...

(But whatever your answer, you can still call it whatever you want.)


-- 
Alastair Reid        reid@cs.utah.edu        http://www.cs.utah.edu/~reid/