这便是haskell没有while或for循环的原因,我们的替代方案是使用递归。
That's why there are no while loops or for loops in Haskell and instead we many times have to use recursion to declare what something is.
获得新版本后,我们将调用这个 find() 方法,替代前面介绍的递归函数,您也应该如此。
We will be substituting a call to this find() method for our recursive function described previously when we get this new version, and so should you.
几乎在任何情况下都可以用循环替代递归。
应用推荐