jam*_*her 11 haskell syntax-error
鉴于以下内容,
module Foo where
main = do
let foo = case 0 of
0 -> 4
return ()
Run Code Online (Sandbox Code Playgroud)
GHC坚持认为我有语法错误:
Make.hs:5:5: parse error (possibly incorrect indentation)
Run Code Online (Sandbox Code Playgroud)
为什么?我已经使用了Haskell一段时间了,它看起来对我来说是正确的.
sea*_*mcl 18
do语法中的多行表达式必须缩进到变量名之外:
main = do
let foo = case 0 of
0 -> 4
return ()
Run Code Online (Sandbox Code Playgroud)
没事,但是
main = do
let foo = case 0 of
0 -> 4
return ()
Run Code Online (Sandbox Code Playgroud)
不是.