blob: 3fe803422a0cc53aeaab86f3051e7576b16d4e74 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
|
import cats._, cats.data._, cats.implicits._
trait Context
object Main {
def foo(f: implicit Int => Int): Int = {
implicit val x: Int = 1
f
}
def main(args: Array[String]): Unit = {
val x = Applicative[List].pure(1)
assert(x == List(1))
val value = foo(implicit x => x + 1)
assert(value == 2)
}
}
|