Strange error in show for datatype

Dylan Thurston dpt@math.harvard.edu
Thu, 4 Oct 2001 17:50:18 +0900


On Wed, Oct 03, 2001 at 11:52:30AM -0400, Jan-Willem Maessen wrote:
> Earlier, Simon says:
> > Indeed, if none of the classes have a method that returns
> > an a-value without also consuming one (urk-- strictly, I think, sigh)
> > then the same holds.
> 
> Strictness alas matters.  Here's the witness:
> 
> class Num a => ZeroList a where
>   consZero :: a -> [a]
>   consZero _ = 0:xs

Err, "Num a" is already a bad context by Simon's criterion because of
"fromInteger", which is what ultimately causes the problem in this
case.

I don't see how strictness can be relevant, since it is a property of
a class instance, not a class.

Best,
	Dylan