0

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 1

5

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]
Sign up to request clarification or add additional context in comments.

1 Comment

@Nicholas Make sure that you have the proper keyboard layout set (preferably US or UK).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.