I'm trying to define a data type to represent numbers in binary, octal and hexadecimal. The idea is to use this data type to define some functions in order to convert from octal to binary, from binary to hexadecimal and from octal to hexadecimal
This what I have until now..
data Number = Bin[Char] | Hex[Char]| Oct[Char]
deriving Show
oct2Bin :: Number -> Number
bin2Hex :: Number -> Number
oct2Hex :: Number -> Number
But I'm stuck here and I don't know if I'm on the right track. I would appreciate any help I can get on this matter.
IntorInteger)?