Created
September 16, 2011 10:34
-
-
Save missingfaktor/1221800 to your computer and use it in GitHub Desktop.
Using applicative in Scala
This file contains hidden or 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
| scala> (List(40, 50, 60) <*> (List(1, 2, 3) map ((_: Int) * (_: Int)).curried)) | |
| res2: List[Int] = List(40, 50, 60, 80, 100, 120, 120, 150, 180) | |
| scala> (List(1, 2, 3) |@| List(40, 50, 60)) { _ * _ } | |
| res4: List[Int] = List(40, 50, 60, 80, 100, 120, 120, 150, 180) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment