I am trying to define an algebraic type:
data MyType t = MyType t
And make it an instance of Show:
instance Show (MyType t) where
show (MyType x) = "MyType: " ++ (show x)
The GHC complains because it cannot deduce that the type 't' in 'Show (MyType t)' is actually an instance of Show, which is needed for (show x).
I have no idea where and how to declare 't' as an instance of Show?
sold
source
share