<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Wed, Apr 15, 2015 at 12:21 PM, Shishir Srivastava <span dir="ltr"><<a href="mailto:shishir.srivastava@gmail.com" target="_blank">shishir.srivastava@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div>I am trying to run the following from the GHCi command prompt which results in parse error.<br></div></div></blockquote><div><br></div><div>Urgh, sorry.</div><div><br></div><div>ghci is not ghc, and requires `let` even in the multi-line mode.</div><div><br></div><div><font face="monospace, monospace"> :{</font></div><div><font face="monospace, monospace"> let foo :: Maybe String</font></div><div><font face="monospace, monospace"> foo = do</font></div><div><font face="monospace, monospace"> x <- Just 3</font></div><div><font face="monospace, monospace"> y <- Just "!"</font></div><div><font face="monospace, monospace"> Just (show x ++ y)</font></div><div><font face="monospace, monospace"> :}</font></div><div><br></div><div>In general, you are better off using files for definitions, and treat the prompt as a debugger or desk calculator. Multi-line mode doesn't really change this.</div><div><br></div></div>-- <br><div class="gmail_signature"><div dir="ltr"><div>brandon s allbery kf8nh sine nomine associates</div><div><a href="mailto:allbery.b@gmail.com" target="_blank">allbery.b@gmail.com</a> <a href="mailto:ballbery@sinenomine.net" target="_blank">ballbery@sinenomine.net</a></div><div>unix, openafs, kerberos, infrastructure, xmonad <a href="http://sinenomine.net" target="_blank">http://sinenomine.net</a></div></div></div>
</div></div>