以下代码得到"解析错误"在let子句中(在GHC 7.8.3中):
someFunction = do {
let foo = bar;
return foo;
}
如何纠正它以获得与此相当的效果?
someFunction = do
let foo = bar
return foo
答案 0 :(得分:6)
someFunction = do {
let foo = bar
; return foo
}
或
someFunction = do {
let { foo = bar };
return foo
}