@@ -7,7 +7,7 @@ object Test {
7
7
8
8
def main (args : Array [String ]): Unit = withQuoteContext {
9
9
10
- implicit def ValueOfExprInt : ValueOfExpr [Int ] = new {
10
+ implicit def UnliftableInt : Unliftable [Int ] = new {
11
11
def apply (n : Expr [Int ])(using QuoteContext ): Option [Int ] = n match {
12
12
case ' { 0 } => Some (0 )
13
13
case ' { 1 } => Some (1 )
@@ -16,15 +16,15 @@ object Test {
16
16
}
17
17
}
18
18
19
- implicit def ValueOfExprBoolean : ValueOfExpr [Boolean ] = new ValueOfExpr [Boolean ] {
19
+ implicit def UnliftableBoolean : Unliftable [Boolean ] = new Unliftable [Boolean ] {
20
20
def apply (b : Expr [Boolean ])(using QuoteContext ): Option [Boolean ] = b match {
21
21
case ' { true } => Some (true )
22
22
case ' { false } => Some (false )
23
23
case _ => None
24
24
}
25
25
}
26
26
27
- implicit def ValueOfExprList [T : ValueOfExpr : Type ]: ValueOfExpr [List [T ]] = new {
27
+ implicit def UnliftableList [T : Unliftable : Type ]: Unliftable [List [T ]] = new {
28
28
def apply (xs : Expr [List [T ]])(using QuoteContext ): Option [List [T ]] = (xs : Expr [Any ]) match {
29
29
case ' { ($xs1 : List [T ]).:: ($x) } =>
30
30
for { head <- x.getValue; tail <- xs1.getValue }
@@ -34,7 +34,7 @@ object Test {
34
34
}
35
35
}
36
36
37
- implicit def ValueOfExprOption [T : ValueOfExpr : Type ]: ValueOfExpr [Option [T ]] = new {
37
+ implicit def UnliftableOption [T : Unliftable : Type ]: Unliftable [Option [T ]] = new {
38
38
def apply (expr : Expr [Option [T ]])(using QuoteContext ): Option [Option [T ]] = expr match {
39
39
case ' { Some [T ]($x) } => for (v <- x.getValue) yield Some (v)
40
40
case ' { None } => Some (None )
0 commit comments