blob: 5d3eb8611139aed1aeed6e4e556805ff866b5769 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
class Result[+A]
case class Success[A](x: A) extends Result[A]
class Apply[A]
object Apply {
def apply[A](f: Int => Result[A]): Apply[A] = new Apply[A]
}
object TestUnit {
def goo : Apply[Option[Int]] = Apply { i =>
val p = i match {
case 1 => Success(Some(1))
case _ => Success(None)
}
}
}
|