Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def foldl(arr: List[Int], default: Int, oper: IntxInt -> Int) = {
- arr match {
- case [] => default
- case _ => foldl(arr.tail, oper(default, arr.head), oper)
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement