title: Haskell: data type for representation of binary, hexadecimal, and octal
body: <p>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</p>
  
  <p>This what I have until now.. </p>
  
  <pre><code>data Number = Bin[Char] | Hex[Char]| Oct[Char]
                                            deriving Show
  
  oct2Bin :: Number -&gt; Number
  bin2Hex :: Number -&gt; Number
  oct2Hex :: Number -&gt; Number
  </code></pre>
  
  <p>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.</p>