help

Brent Yorgey byorgey at seas.upenn.edu
Tue Mar 8 16:15:35 CET 2011


On Tue, Mar 08, 2011 at 12:40:23PM +0800, Simon Sin wrote:
> Hi! I'm new to Haskell.  Following someone's notes, I was doing this
> "doubleMe x = x + x".  I did this two days ago and it worked.  But I try to
> do it today, I got an error "parse error on input '=' ",

If you put

  doubleMe x = x + x

by itself in a .hs file and load it into ghci, it should work just
fine.  On the other hand, you cannot simply type it at the ghci
prompt; you will get a parse error like the one you mentioned.  ghci
only allows you to enter expressions, not declarations.

-Brent



More information about the Glasgow-haskell-users mailing list