Strange error in show for datatype

Marcin 'Qrczak' Kowalczyk qrczak@knm.org.pl
4 Oct 2001 15:32:46 GMT


Thu, 4 Oct 2001 06:05:16 -0700, Simon Peyton-Jones <simonpj@microsoft.com> pisze:

> 	data T a = T1 Int | T2 a
> 
> It's clear that (T1 Int) has no a's in it, not even bottom.

instance Show a => Show (T a) where
    show x = show (tail [case x of T2 y -> y])

We have show (T1 0 :: T Int) == "[]", show (T1 0 :: T Char) == "\"\"".

-- 
 __("<  Marcin Kowalczyk * qrczak@knm.org.pl http://qrczak.ids.net.pl/
 \__/
  ^^                      SYGNATURA ZASTĘPCZA
QRCZAK