Created
November 11, 2019 11:53
-
-
Save softberries/dd09014f5bb488d29fe71d14f9480295 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
val complexProduct = List( | |
List( | |
Some(10), | |
None | |
), | |
List( | |
Some(22) | |
) | |
) | |
val doubleCP = Functor[List].compose[List].compose[Option].map(complexProduct)(_ * 2) | |
println(doubleCP) //List(List(Some(20), None), List(Some(44))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment