【发布时间】:2013-05-17 13:23:45
【问题描述】:
如果我在学校没记错的话,有一个函数或关键字用于“尚未实现”,但代码可以编译。我试图搜索它,但找不到。有人知道我在找什么吗?
有点像
isDivisor :: Integer -> Integer -> Bool
isDivisor x y = None
--isDivisor x y = (rem x y) == 0
【问题讨论】:
-
使用
undefined。当你调用该函数时,你会得到***Exception: Prelude.undefined。 -
或者,
isDivisor x y = error "Not yet implemented",或者,如果你想让 ghci 循环,isDivisor x y = isDivisor x y。