Skip to content

Instantly share code, notes, and snippets.

@softberries
Created November 11, 2019 11:53
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 softberries/dd09014f5bb488d29fe71d14f9480295 to your computer and use it in GitHub Desktop.
Save softberries/dd09014f5bb488d29fe71d14f9480295 to your computer and use it in GitHub Desktop.
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