Implict parameters and monomorphism

Andreas Rossberg rossberg@ps.uni-sb.de
Thu, 03 May 2001 14:23:27 +0200


Lennart Augustsson wrote:
> 
> But most importantly, this was a bad example.  There was a much better
> one posted on this mailing list a while ago.  Does anyone remember it?

No, but this should do it:

data T = T Int

instance Show T where
	show (T n) = show n

instance Eq

instance Num T where
	fromInteger n = T n
	(+) (T _) (T _) = T 0

x :: T	-- try removing this type signature
x = 1 + 2

main = putStr (show x)


	- Andreas

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

"Computer games don't affect kids.
 If Pac Man affected us as kids, we would all be running around in
 darkened rooms, munching pills, and listening to repetitive music."