I'm trying to write some code in Haskell using ghci 7.8.3.
When I type this code [x*2 ¦ x <- [1..10]] it gives me an error saying that it does not understand what <- is. What am I doing wrong?
1 Answer
That's because it should be like this:
[x*2 | x <- [1..10]] -- notice | instead of ¦
Sample demo in ghci:
λ> [x*2 ¦ x <- [1..10]]
<interactive>:2:10: parse error on input `<-'
λ> [x*2 | x <- [1..10]]
[2,4,6,8,10,12,14,16,18,20]
1 Comment
Sibi
@Nicholas Make sure that you have the proper keyboard layout set (preferably US or UK).