开发者

Not in scope 'foldrl'

开发者 https://www.devze.com 2023-03-06 07:25 出处:网络
When trying to define the function maximum\' :: (Ord a) => [a] -> a maximum\' = foldrl (\\x acc -> if x > acc then x else acc)

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

精彩评论

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