小编Ali*_*ite的帖子

Haskell - 变量不在范围内错误 - 初学者

我是 Haskell 新手,无法找出我的代码出了什么问题。我不断收到变量超出范围的错误。

这是我使用加载到 GHCi 中的代码:load

validLength :: String -> Bool
validLength xs | length xs == 26 = True
               | otherwise = False
Run Code Online (Sandbox Code Playgroud)

然后我输入validLength aawhich 应该返回 false 但我收到错误。

*Main> validLength aa

<interactive>:1:13: error: Variable not in scope: aa :: String
Run Code Online (Sandbox Code Playgroud)

haskell new-operator

5
推荐指数
1
解决办法
7388
查看次数

标签 统计

haskell ×1

new-operator ×1