I have
data Dictionary a = Empty
| Branch (a, Bool, Dictionary a) (Dictionary a)
deriving (Ord, Eq)
instance Show (Dictionary a) where show = showDict
showDict (Branch (val, e, dict) dict2) = "My dict is : " ++ val
I know it is definitely wrong but I could not find how to write this one. In showDict function type of val is a but expected type is [Char].
Thanks in advance.
To turn
valinto a string,showit:And don’t forget the type constraints on
showDict: