title: How do I use a let within a do block in ghci?
body: <p>I'm trying to create a do block interactively in ghci. As long as I don't define a variable with in block, it's fine:</p>
  
  <pre><code>Prelude&gt;let a = do putStrLn "test"; putStrLn "other test"
  Prelude&gt;
  </code></pre>
  
  <p>but I can't figure out how to define a let construction in the do block interactively without getting a parse error:</p>
  
  <pre><code>Prelude&gt; let a = do let b = 5; putStrLn $ show b
  
  &lt;interactive&gt;:2:40:
      parse error (possibly incorrect indentation or mismatched brackets)
  </code></pre>
  
  <p>Obviously </p>
  
  <pre><code>let a = do
       let b = 5
       putStrLn $ show b
  </code></pre>
  
  <p>is entirely fine in a Haskell source file. I'm just having trouble figuring out how to translate that to ghci.</p>