Last active
December 10, 2019 04:12
-
-
Save justinhj/d5ee4fec34873b6cf4a8c0aace117561 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import cats.Foldable | |
// Combining a list with a foldLeft | |
Foldable[List].foldLeft(List(1,2,3), 0){_ |+| _} | |
// res1: Int = 6 | |
// Combining a list of string with a foldLeft | |
Foldable[List].foldLeft(List("1","2","3"), "")(_ |+| _) | |
// res2: String = "123" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment