I wish to define addition between two chars as concatination but im unsure of how to properly do so.
my attempt:
instance Num Char where
(+) (a) (b) = [a] ++ [b]
but the error i get is that the return type is not the expected one.
My expected output is as stated a list of Char which is formed by concatinating the two chars.
(+) :: Num a => a -> a -> a; you want something with typeChar -> Char -> [Char].+that fit the signature, you can't define aNuminstance without also defining(*),abs,signum,fromInteger, and eithernegateor(-). And if you do define them, they still need to obey various laws likea + b == b + aandx + fromInteger 0 == x. The kind of operator overloading provided by type classes is not the free-for-all, any-definition-goes kind provided by other languages.Naturaltype doesn't have a reasonable definition ofnegateor(-), and it breaks a lot of the "laws" (which aren't actually defined in the report).