title: Haskell Parse error on 'let'
body: <p>So I'm new to Haskell and I have to program Rabin Karps algorithm.
  I feel like my answer should work, but I keep getting a "parse error on 'let'" error when I compile.
  Could anybody help me out.</p>
  
  <p>Here is my code:</p>
  
  <pre><code>import Data.Char
  
  hash :: String -&gt; Int
  hash [] = -1
  hash (x:xs) = ((ord x))
  
  rabinKarp :: String -&gt; String -&gt; Bool
  rabinKarp [] _ = False
  rabinKarp mainString patternString
      let
       hashPattern = hash patternString
       hashMain = hash (take (length pattern) mainString)
      if hashPattern == hashMain
      then True
      else rabinKarp (drop 1 mainString) patternString
  </code></pre>