Skip to content

Instantly share code, notes, and snippets.

@missingfaktor
Created September 16, 2011 10:34
Show Gist options
  • Select an option

  • Save missingfaktor/1221800 to your computer and use it in GitHub Desktop.

Select an option

Save missingfaktor/1221800 to your computer and use it in GitHub Desktop.
Using applicative in Scala
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