Say I have the following type:
newtype T1 a = T1 a
I can make a Show
instance for it:
instance showT1Generic :: Show a => Show (T1 a) where
show (T1 a) = "generic: " <> show a
However, let's say I want to do something special for types T1 Int
. I tried doing this:
instance showT1Int :: Show (T1 Int) where
show (T1 a) = "int: " <> show a
and it compiles, however running in psci
doesn't work as expected:
> T1 'a'
generic: 'a'
> T1 1
generic: 1
Am I doing this wrong?