I am using ghci compiler with version 7.8.3 on windows 7. I am getting error message showing parse error on input `->'. I have the following code for lambda expression in haskell.
add =\x y -> x+y
When defining a function interactively in ghci, you have to bind it using a let like this:
let add = \x y -> x + y
add x y = x + y, or just add = (+).= and \ must be separated by space like here, because =\ is a legal operator name.
=\is an operator. Since you want to assign a lambda expression to the nameadd, you need a space:= \.