title: Decimal and binary number handling
body: <p>I'm working on a code which capable of converting decimal to a binary value. Comparing to other languages haskell needs few lines of code to bring this up. Below is the code i worked out. </p>
  
  <pre><code>binaryToDec :: [Int] -&gt; Int
  binaryToDec [] = []
  binaryToDec (x:xs) = (+) (x * 2 ^(length xs))
  </code></pre>
  
  <p>this code gives an error which i tried so hard to figure out. but i couldn't. </p>
  
  <pre><code>Assignment.hs:61:18:
      Couldn't match expected type `Int' with actual type `[a0]'
      In the expression: []
      In an equation for `binaryToDec': binaryToDec [] = []
  </code></pre>
  
  <p>what should i do?</p>