在下面的代碼: ismaxl :: (Ord a) => [a] -> a -> Bool
ismaxl l x = x == maxel
where maxel = maximum l
main = do
let mylist = [1, 2, 3, 5]
let ismax = ismaxl mylist
--Is each call O(1)
def mainCaller() = {
val name = "xyz"
someList.foreach { u:Map => foo(name, u) }
}
def foo(name:String)(map:Map): Unit = {
//match case....
//recursive call to foo in each case