@@ -7,7 +7,7 @@ object Test {
77
88 def main (args : Array [String ]): Unit = withQuoteContext {
99
10- implicit def ValueOfExprInt : ValueOfExpr [Int ] = new {
10+ implicit def UnliftableInt : Unliftable [Int ] = new {
1111 def apply (n : Expr [Int ])(using QuoteContext ): Option [Int ] = n match {
1212 case ' { 0 } => Some (0 )
1313 case ' { 1 } => Some (1 )
@@ -16,15 +16,15 @@ object Test {
1616 }
1717 }
1818
19- implicit def ValueOfExprBoolean : ValueOfExpr [Boolean ] = new ValueOfExpr [Boolean ] {
19+ implicit def UnliftableBoolean : Unliftable [Boolean ] = new Unliftable [Boolean ] {
2020 def apply (b : Expr [Boolean ])(using QuoteContext ): Option [Boolean ] = b match {
2121 case ' { true } => Some (true )
2222 case ' { false } => Some (false )
2323 case _ => None
2424 }
2525 }
2626
27- implicit def ValueOfExprList [T : ValueOfExpr : Type ]: ValueOfExpr [List [T ]] = new {
27+ implicit def UnliftableList [T : Unliftable : Type ]: Unliftable [List [T ]] = new {
2828 def apply (xs : Expr [List [T ]])(using QuoteContext ): Option [List [T ]] = (xs : Expr [Any ]) match {
2929 case ' { ($xs1 : List [T ]).:: ($x) } =>
3030 for { head <- x.getValue; tail <- xs1.getValue }
@@ -34,7 +34,7 @@ object Test {
3434 }
3535 }
3636
37- implicit def ValueOfExprOption [T : ValueOfExpr : Type ]: ValueOfExpr [Option [T ]] = new {
37+ implicit def UnliftableOption [T : Unliftable : Type ]: Unliftable [Option [T ]] = new {
3838 def apply (expr : Expr [Option [T ]])(using QuoteContext ): Option [Option [T ]] = expr match {
3939 case ' { Some [T ]($x) } => for (v <- x.getValue) yield Some (v)
4040 case ' { None } => Some (None )
0 commit comments