[Haskell] Num is such a fat and greedy class

Andreas Rossberg rossberg at ps.uni-sb.de
Mon Dec 11 09:21:06 EST 2006

Lennart Augustsson wrote:
>> let data Bar = ... in  ...
> If you allow this you need to be very careful about type equality.  When 
> is Bar equal to Bar?
> If it's inside a recursive function, does each invocation get its own 
> Bar?  (In SML the answer is yes.)

Can you give an example of how this would be observable in SML? AFAICS, 
there is no way to tell the difference, because generative type names 
are not allowed to escape their scope. (You can observe dynamic 
generativity of exception constructors, though.)

> If you decide the answer is no, then 
> is the beta rule still valid?

I think with the scoping restrictions in place the beta rule would not 
be affected.

- Andreas

Andreas Rossberg, rossberg at ps.uni-sb.de

More information about the Haskell mailing list