Bas*_*ato 5 syntax haskell sublimetext sublimetext2
对不起,可能是一个菜鸟问题.
我明白了:
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>
Run Code Online (Sandbox Code Playgroud)
即x==1工作,但如果我改变x == 1它没有.但那是为什么呢?例如,1 == 1似乎很好地工作.
编译器版本:
$ ghci --version
The Glorious Glasgow Haskell Compilation System, version 7.6.3
Run Code Online (Sandbox Code Playgroud)
添加了证明截图; 很难看到,但你可以看到输入行不包含任何奇怪的东西.

| 归档时间: |
|
| 查看次数: |
191 次 |
| 最近记录: |