开发者

Not in scope 'foldrl'

When trying to define the function

maximum' :: (Ord a) => [a] -> a
maximum' = foldrl (\x acc -> if x > acc then x else acc)
开发者_开发百科

ghci reports the error:

Not in scope: `foldrl'
Failed, modules loaded: none.
Ubuntu 10.04
$ ghci --version
The Glorious Glasgow Haskell Compilation System, version 6.12.1

Why isn't the function foldrl in scope?


Ohhh, you want foldr1 not foldrl, the last character is a 1, not an l


I think you mean foldr1 (last character is the digit 1), not foldrl.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜