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
.
精彩评论