Advertisement
Guest User

Untitled

a guest
Sep 4th, 2014
216
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Scala 0.17 KB | None | 0 0
  1. def foldl(arr: List[Int], default: Int, oper: IntxInt -> Int) = {
  2.     arr match {
  3.         case [] => default
  4.         case _  => foldl(arr.tail, oper(default, arr.head), oper)
  5.     }
  6. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement