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

乃潇 张 zhangnaixiao at me.com
Wed May 24 01:04:44 UTC 2017


Thanks, I know if using “let”, there’ll be no error. My question is:
1. what does option "—with-ghc” do? 
2. Is it better to remove “—with-ghc” when running in intero REPL? If yes, how to remove it?

> On May 24, 2017, at 12:22 AM, baa dg <aquagnu at gmail.com> wrote:
> 
> try with "let":
> let f x y = x + y
> 
> 2017-05-23 17:04 GMT+03:00 乃潇 张 <zhangnaixiao at me.com <mailto: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 <mailto: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 <mailto:Beginners at haskell.org>
>> http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners <http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners>
> 
> 
> _______________________________________________
> Beginners mailing list
> Beginners at haskell.org <mailto:Beginners at haskell.org>
> http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners <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/20170524/417b0eba/attachment-0001.html>


More information about the Beginners mailing list