Skip to content

Instantly share code, notes, and snippets.

Created June 29, 2017 06:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/2dc5556230b06d7a4ba0ba4006ef2b5f to your computer and use it in GitHub Desktop.
Save anonymous/2dc5556230b06d7a4ba0ba4006ef2b5f to your computer and use it in GitHub Desktop.
the description for this gist
val strings: Observable[String] =
Observable.fromIterable(List("few", "random", "strings"))
val sumLengths: Consumer[String, Int] =
Consumer.foldLeft(0)(_ + _.length)
val sum: Task[Int] = sumLengths(strings)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment