title: Haskell parse error on input `let'
body: <p>Im trying to run this code but I'm getting a parse error on input 'let' on:</p>
  
  <pre><code> let database = tempFilm:database
  </code></pre>
  
  <p>I can't find where the problem is, could you take a look please?</p>
  
  <pre><code>options 7 (username, database) = do   putStrLn "******************"
                                        putStrLn "   Rate a film    "
                                        putStrLn "******************"
                                        putStrLn ""
                                        putStr "Enter the title of the film or nothing to return to the main menu: "
                                        title &lt;- getLine
                                        if title == ""
                                          then return(username, database)
                                        else do let filmCheck = findFilm title database
                                                if filmCheck == []
                                                  then do putStrLn "That film does not exists."
                                                          return (username, database) 
                                                  else do putStr "Enter your rate: "
                                                          tempRate &lt;- getLine
                                                          case reads tempRate :: [(Integer, String)] of
                                                               [(n, "")] -&gt; do let rate = read tempRate :: Int
                                                                               let tempFilm = rateFilm username (username, rate) filmCheck
                                                                               if checkIfRated username tempFilm == True 
                                                                                then do putStrLn "You already voted for this film\n"
                                                                                        putStrLn "Do you want to modify your voted?\n"
                                                                                        putStrLn "Press y to modify or nothing to return to the main menu:"
                                                                                        input &lt;- getLine
                                                                                        if input /= "y"
                                                                                          then return (username, database)
                                                                                        else putStrLn "Your vote will be modified."
                                                                               let database = tempFilm:database
                                                                               putStrLn "You rating has been  sumbited successfully!"
                                                                               putStrLn (displayFilm tempFilm)
                                                                               return (username, database) 
  </code></pre>
  
  <p><strong>Edit:</strong>
  Using when</p>
  
  <pre><code>options 7 (username, database) = do   putStrLn "******************"
                                        putStrLn "   Rate a film    "
                                        putStrLn "******************"
                                        putStrLn ""
                                        putStr "Enter the title of the film or nothing to return to the main menu: "
                                        title &lt;- getLine
                                        if title == ""
                                          then return(username, database)
                                        else do let filmCheck = findFilm title database
                                                if filmCheck == []
                                                  then do putStrLn "That film does not exists."
                                                          return (username, database) 
                                                  else do putStr "Enter your rate: "
                                                          tempRate &lt;- getLine
                                                          case reads tempRate :: [(Integer, String)] of
                                                               [(n, "")] -&gt; do let rate = read tempRate :: Int
                                                                               let tempFilm = rateFilm username (username, rate) filmCheck
                                                                               when (checkIfRated username tempFilm == True) $
                                                                                   do putStrLn "You already voted for this film\n"
                                                                                      putStrLn "Do you want to modify your vote?\n"
                                                                                      putStrLn "Press y to modify or nothing to return to the main menu:"
                                                                                      input &lt;- getLine
                                                                                      if input /= "y"
                                                                                        then return (username, database)
                                                                                      else putStrLn "Your vote will be modified."
                                                                               let database = tempFilm:database
                                                                               putStrLn "You rating has been  sumbited successfully!"
                                                                               putStrLn (displayFilm tempFilm)
                                                                               return (username, database) 
  </code></pre>
  
  <p>My syntax might no correct I've never use when before</p>