@@ -16,44 +16,18 @@ abstract class Liftable[T] {
16
16
*/
17
17
object Liftable {
18
18
19
- implicit def BooleanIsLiftable : Liftable [Boolean ] = new Liftable [Boolean ] {
20
- def toExpr (x : Boolean ): Expr [Boolean ] = liftedExpr(x)
21
- }
22
-
23
- implicit def ByteIsLiftable : Liftable [Byte ] = new Liftable [Byte ] {
24
- def toExpr (x : Byte ): Expr [Byte ] = liftedExpr(x)
25
- }
26
-
27
- implicit def CharIsLiftable : Liftable [Char ] = new Liftable [Char ] {
28
- def toExpr (x : Char ): Expr [Char ] = liftedExpr(x)
29
- }
30
-
31
- implicit def ShortIsLiftable : Liftable [Short ] = new Liftable [Short ] {
32
- def toExpr (x : Short ): Expr [Short ] = liftedExpr(x)
33
- }
34
-
35
- implicit def IntIsLiftable : Liftable [Int ] = new Liftable [Int ] {
36
- def toExpr (x : Int ): Expr [Int ] = liftedExpr(x)
37
- }
38
-
39
- implicit def LongIsLiftable : Liftable [Long ] = new Liftable [Long ] {
40
- def toExpr (x : Long ): Expr [Long ] = liftedExpr(x)
41
- }
42
-
43
- implicit def FloatIsLiftable : Liftable [Float ] = new Liftable [Float ] {
44
- def toExpr (x : Float ): Expr [Float ] = liftedExpr(x)
45
- }
46
-
47
- implicit def DoubleIsLiftable : Liftable [Double ] = new Liftable [Double ] {
48
- def toExpr (x : Double ): Expr [Double ] = liftedExpr(x)
49
- }
50
-
51
- implicit def StringIsLiftable : Liftable [String ] = new Liftable [String ] {
52
- def toExpr (x : String ): Expr [String ] = liftedExpr(x)
53
- }
54
-
55
- implicit def ClassIsLiftable [T ]: Liftable [Class [T ]] = new Liftable [Class [T ]] {
56
- def toExpr (x : Class [T ]): Expr [Class [T ]] = liftedExpr(x)
19
+ implied for Liftable [Boolean ] = new PrimitiveLifable
20
+ implied for Liftable [Short ] = new PrimitiveLifable
21
+ implied for Liftable [Int ] = new PrimitiveLifable
22
+ implied for Liftable [Long ] = new PrimitiveLifable
23
+ implied for Liftable [Float ] = new PrimitiveLifable
24
+ implied for Liftable [Double ] = new PrimitiveLifable
25
+ implied for Liftable [Char ] = new PrimitiveLifable
26
+ implied for Liftable [String ] = new PrimitiveLifable
27
+ implied ClassIsLiftable [T ] for Liftable [Class [T ]] = new PrimitiveLifable // FIXME: annonymous implied with type parameter not working
28
+
29
+ private class PrimitiveLifable [T ] extends Liftable [T ] {
30
+ override def toExpr (x : T ): Expr [T ] = liftedExpr(x)
57
31
}
58
32
59
33
}
0 commit comments