[Haskell] Num is such a fat and greedy class

Lennart Augustsson lennart at augustsson.net
Mon Dec 11 08:57:15 EST 2006


On Dec 11, 2006, at 03:50 , Johannes Waldmann 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.)  If you decide the answer is no,  
then is the beta rule still valid?  E.g.,
   let x = (let Bar = ... in ...) in ... x ... x ...
expand x (which has always been semantically valid in Haskell)
   ... (let Bar = ... in ...) ... (let Bar = ... in ...) ...
Are those two Bar types equal?

In Cayenne I allowed all these things, but the price is that Cayenne  
has structural equality on types rather than nominal.  Switching to  
nominal to structural would be a major change in Haskell.

So this change may look innocuous, but it has big ramifications.

	-- Lennart


More information about the Haskell mailing list