Skip to content

Instantly share code, notes, and snippets.

@debasishg
Created September 7, 2012 17:48
Show Gist options
  • Save debasishg/3668131 to your computer and use it in GitHub Desktop.
Save debasishg/3668131 to your computer and use it in GitHub Desktop.
Changes in scalaz-core_2.10.0-M7 ver 7.0.0.M3 ?
Welcome to Scala version 2.10.0-M7 (Java HotSpot(TM) Client VM, Java 1.7.0_01).
Type in expressions to have them evaluated.
Type :help for more information.
scala> import scalaz._
import scalaz._
scala> import Scalaz._
import Scalaz._
scala> List(1,2,3,4) <*> List(((i: Int) => i * 2), (i: Int) => i * 3)
res0: List[(Int, Int => Int)] = List((1,<function1>), (1,<function1>), (2,<function1>), (2,<function1>), (3,<function1>), (3,<function1>), (4,<function1>), (4,<function1>))
scala> Apply[List].ap(List(1,2,3,4))(List(((i: Int) => i * 2), ((i: Int) => i * 3)))
res2: List[Int] = List(2, 4, 6, 8, 3, 6, 9, 12)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment