Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- trait FoldLeft[M[_]] {
- def foldLeft[A, B](ma: M[A], b: B, op: (B, A) => B): B
- }
- object FoldLeft {
- implicit object ListFoldLeft extends FoldLeft[List] {
- def foldLeft[A, B](ma: List[A], b: B, op: (B, A) => B) = ma.foldLeft(b)(op)
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment