title: Defining variables inside a function Haskell
body: <p>I am a huge newbie to Haskell, I actually just started 10 minutes ago. I am trying to figure out how to define a variable inside a function. Lets say I have the function</p>
  
  <pre><code>foo :: Int -&gt; Int
  foo a = 
      b = a * 2
      b
  -- Yes, I know, it doesn't do anything interesting
  </code></pre>
  
  <p>When I run it in <code>GHCi</code> I get a syntax error! How can you define a variable inside a function?</p>