object Example3 {
import cats.Functor
import cats.std.list._
import cats.std.option._
import cats.syntax.functor._
def mul2[F[_]: Functor](functor: F[Int]): F[Int] = functor.map(_ * 2)
mul2(List(5, 2, 3))
mul2(Option(2))
}
Tuesday, October 20, 2015
Subscribe to:
Post Comments (Atom)
0 comments:
Post a Comment