GHCI parse bug?
Hal Daume III
hdaume@ISI.EDU
Wed, 16 Oct 2002 11:32:16 -0700 (PDT)
Yes, the spaces are necessary. This is because of the maximal munch
rule; it assumes that '->\' is an identifier. In fact, you can define it
as such:
Prelude> let (->\) a b = a + b
Prelude> 5 ->\ 6
11
Prelude>
You can of course write
Prelude> let f = \x y z -> x (map (+y) z)
if you wish.
--
Hal Daume III
"Computer science is no more about computers | hdaume@isi.edu
than astronomy is about telescopes." -Dijkstra | www.isi.edu/~hdaume
On Wed, 16 Oct 2002, Bryn Keller wrote:
> Prelude> let f = \x->\y->\z->x (map (+ y) z)
> <interactive>:1: parse error on input `->\'
> Prelude> let f = \x-> \y-> \z-> x (map (+ y) z)
> Prelude>
>
> Are the spaces really necessary, or is this a bug?
>
> Thanks,
>
> Bryn
>
> _______________________________________________
> Glasgow-haskell-users mailing list
> Glasgow-haskell-users@haskell.org
> http://www.haskell.org/mailman/listinfo/glasgow-haskell-users
>