Skip to content

Instantly share code, notes, and snippets.

@wkimeria
Created December 4, 2016 01:51
Show Gist options
  • Save wkimeria/8da36eeab0bd10814740cb868ead21f2 to your computer and use it in GitHub Desktop.
Save wkimeria/8da36eeab0bd10814740cb868ead21f2 to your computer and use it in GitHub Desktop.
def foldLeftViaFoldRight[A,B](l: List[A], z: B)(f: (B,A) => B): B =
foldRight(l, (b:B) => b)((a,g) => b => g(f(b,a)))(z)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment