[Haskell-beginners] Got "parse error on input ‘=’” in Emacs Intero REPL when define any function

乃潇 张 zhangnaixiao at me.com
Tue May 23 13:58:41 UTC 2017


Hi, I am trying to define some functions in a REPL window of emacs intero. However, I always got "parse error on input ‘=’” as blow:

Starting:
  stack ghci --with-ghc intero "--docker-run-args=--interactive=true --tty=false" --no-build --no-load --ghci-options -odir=/Users/spike/Code/haskell/learn-haskell/baby/.stack-work/intero/intero445zea --ghci-options -hidir=/Users/spike/Code/haskell/learn-haskell/baby/.stack-work/intero/intero445zea baby
Intero 0.1.20 (GHC 8.0.2)
Type :intro and press enter for an introduction of the standard commands.

 addTwo x y = x + y

<interactive>:2:12: error:
    parse error on input ‘=’
    Perhaps you need a 'let' in a 'do' block?
    e.g. 'let x = 5' instead of 'x = 5’

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?


Thanks,
Sid
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/beginners/attachments/20170523/f7530171/attachment.html>


More information about the Beginners mailing list