<div dir="ltr"><div>try with "let":<br></div><div>let f x y = x + y<br></div></div><div class="gmail_extra"><br><div class="gmail_quote">2017-05-23 17:04 GMT+03:00 乃潇 张 <span dir="ltr"><<a href="mailto:zhangnaixiao@me.com" target="_blank">zhangnaixiao@me.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word">I find if I run “<font face="Courier New">stack ghci intero</font>” (remove the “<font face="Courier New">—with-ghc</font>”) from terminal, then the issue will not occur. Does anyone have idea why?<div><br><div><blockquote type="cite"><div><div class="h5"><div>On May 23, 2017, at 9:58 PM, 乃潇 张 <<a href="mailto:zhangnaixiao@me.com" target="_blank">zhangnaixiao@me.com</a>> wrote:</div><br class="m_613588249055399846Apple-interchange-newline"></div></div><div><div><div class="h5"><div style="word-wrap:break-word">Hi, I am trying to define some functions in a REPL window of emacs intero. However, I always got "<font face="Courier New">parse error on input ‘=’</font>” as blow:<div><br></div><div><div><font face="Courier New">Starting:</font></div><div><font face="Courier New"> stack ghci --with-ghc intero "--docker-run-args=--<wbr>interactive=true --tty=false" --no-build --no-load --ghci-options -odir=/Users/spike/Code/<wbr>haskell/learn-haskell/baby/.<wbr>stack-work/intero/intero445zea --ghci-options -hidir=/Users/spike/Code/<wbr>haskell/learn-haskell/baby/.<wbr>stack-work/intero/intero445zea baby</font></div><div><font face="Courier New">Intero 0.1.20 (GHC 8.0.2)</font></div><div><font face="Courier New">Type :intro and press enter for an introduction of the standard commands.</font></div><div><font face="Courier New"><br></font></div><div><font face="Courier New"> addTwo x y = x + y</font></div><div><font face="Courier New"><br></font></div><div><font face="Courier New"><interactive>:2:12: error:</font></div><div><font face="Courier New"> parse error on input ‘=’</font></div><div><font face="Courier New"> Perhaps you need a 'let' in a 'do' block?</font></div><div><font face="Courier New"> e.g. 'let x = 5' instead of 'x = 5’</font></div></div><div><br></div><div>I did some research, seems like “let” is not a must here for ghci version above 8.0. And my ghc version is 8.0.2. So is it a issue of ghci or intero?</div><div><br></div><div><br></div><div>Thanks,</div><div>Sid</div></div></div></div>______________________________<wbr>_________________<br>Beginners mailing list<br><a href="mailto:Beginners@haskell.org" target="_blank">Beginners@haskell.org</a><br><a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners" target="_blank">http://mail.haskell.org/cgi-<wbr>bin/mailman/listinfo/beginners</a><br></div></blockquote></div><br></div></div><br>______________________________<wbr>_________________<br>
Beginners mailing list<br>
<a href="mailto:Beginners@haskell.org">Beginners@haskell.org</a><br>
<a href="http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners" rel="noreferrer" target="_blank">http://mail.haskell.org/cgi-<wbr>bin/mailman/listinfo/beginners</a><br>
<br></blockquote></div><br></div>