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

baa dg aquagnu at gmail.com
Tue May 23 16:22:04 UTC 2017


try with "let":
let f x y = x + y

2017-05-23 17:04 GMT+03:00 乃潇 张 <zhangnaixiao at me.com>:

> I find if I run “stack ghci intero” (remove the “—with-ghc”) from
> terminal, then the issue will not occur. Does anyone have idea why?
>
> On May 23, 2017, at 9:58 PM, 乃潇 张 <zhangnaixiao at me.com> wrote:
>
> 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
> _______________________________________________
> Beginners mailing list
> Beginners at haskell.org
> http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
>
>
>
> _______________________________________________
> Beginners mailing list
> Beginners at haskell.org
> http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/beginners/attachments/20170523/54e7c38f/attachment.html>


More information about the Beginners mailing list