Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why does this Haskell code become invalid if I add spaces?

Sorry for probably a noob question.

I'm getting this:

Prelude> all (\x -> x==1) ([n | n <- [1..20]])
False
Prelude> all (\x -> x == 1) ([n | n <- [1..20]])

<interactive>:17:44:
    parse error (possibly incorrect indentation or mismatched brackets)
Prelude> 

I.e. x==1 works, but if I change this to x == 1 it doesn't. But why is that? E.g. 1 == 1 seem to work fine.

Compiler Version:

$ ghci --version
The Glorious Glasgow Haskell Compilation System, version 7.6.3

Added screenshot for proof; it's hard to see but you can see the input line doesn't contain anything weird.

enter image description here

like image 248
BasilTomato Avatar asked Nov 01 '22 19:11

BasilTomato


1 Answers

It turns out this behaviour only occurs in Sublime Haskell REPL plugin. I've filed a ticket for this.

like image 175
BasilTomato Avatar answered Nov 15 '22 08:11

BasilTomato