@@ -58,8 +58,8 @@ object Lens {
58
58
getter.unseal match {
59
59
case Function (param :: Nil , Path (o, parts)) if o.symbol == param.symbol =>
60
60
' {
61
- val setter = (t : T ) => (s : S ) => ~ setterBody(('(s)) .unseal, ( ' (t)) .unseal, parts).seal[S ]
62
- apply(~ getter)(setter)
61
+ val setter = (t : T ) => (s : S ) => $ { setterBody((' s ) .unseal, (' t ) .unseal, parts).seal[S ] }
62
+ apply($ getter)(setter)
63
63
}
64
64
case _ =>
65
65
throw new QuoteError (" Unsupported syntax. Example: `GenLens[Address](_.streetNumber)`" )
@@ -77,7 +77,7 @@ object GenLens {
77
77
78
78
def apply [S ] = new MkGenLens [S ]
79
79
class MkGenLens [S ] {
80
- inline def apply [T ](get : => (S => T )): Lens [S , T ] = ~ Lens .impl('( get))
80
+ inline def apply [T ](get : => (S => T )): Lens [S , T ] = $ { Lens .impl(' get ) }
81
81
}
82
82
}
83
83
@@ -122,9 +122,9 @@ object Iso {
122
122
123
123
' {
124
124
// (p: S) => p._1
125
- val to = (p : S ) => ~ { Term .Select .unique(('(p) ).unseal, "_1").seal[A] }
125
+ val to = (p : S ) => $ { Term .Select .unique((' p ).unseal, " _1" ).seal[A ] }
126
126
// (p: A) => S(p)
127
- val from = (p : A ) => ~ { Term .Select .overloaded(Term .Ident (companion), " apply" , Nil , ('(p) ).unseal :: Nil).seal[S] }
127
+ val from = (p : A ) => $ { Term .Select .overloaded(Term .Ident (companion), " apply" , Nil , (' p ).unseal :: Nil ).seal[S ] }
128
128
apply(from)(to)
129
129
}
130
130
}
@@ -139,7 +139,7 @@ object Iso {
139
139
if (tpS.isSingleton) {
140
140
val ident = Term .Ident (tpS.asInstanceOf [TermRef ]).seal[S ]
141
141
' {
142
- Iso [S , 1 ](Function .const(~ ident))(Function .const(1 ))
142
+ Iso [S , 1 ](Function .const($ ident))(Function .const(1 ))
143
143
}
144
144
}
145
145
else if (tpS.classSymbol.flatMap(cls => if (cls.flags.is(Flags .Case )) Some (true ) else None ).nonEmpty) {
@@ -156,7 +156,7 @@ object Iso {
156
156
val obj = Term .Select .overloaded(Term .Ident (companion), " apply" , Nil , Nil ).seal[S ]
157
157
158
158
' {
159
- Iso [S , 1 ](Function .const(~ obj))(Function .const(1 ))
159
+ Iso [S , 1 ](Function .const($ obj))(Function .const(1 ))
160
160
}
161
161
}
162
162
else {
@@ -176,12 +176,12 @@ object GenIso {
176
176
* { p => p._1 }
177
177
* { p => Person(p) }
178
178
*/
179
- inline def apply [S , A ]: Iso [S , A ] = ~ Iso .impl[S , A ]
179
+ inline def apply [S , A ]: Iso [S , A ] = $ { Iso .impl[S , A ] }
180
180
181
181
// TODO: require whitebox macro
182
- inline def fields [S ]: Iso [S , Any ] = ~ Iso .implFields[S ]
182
+ inline def fields [S ]: Iso [S , Any ] = $ { Iso .implFields[S ] }
183
183
184
- inline def unit [S ]: Iso [S , 1 ] = ~ Iso .implUnit[S ]
184
+ inline def unit [S ]: Iso [S , 1 ] = $ { Iso .implUnit[S ] }
185
185
}
186
186
187
187
trait Prism [S , A ] { outer =>
@@ -221,5 +221,5 @@ object GenPrism {
221
221
* case _ => None
222
222
* }(jstr => jstr)
223
223
*/
224
- inline def apply [S , A <: S ]: Prism [S , A ] = ~ Prism .impl[S , A ]
224
+ inline def apply [S , A <: S ]: Prism [S , A ] = $ { Prism .impl[S , A ] }
225
225
}
0 commit comments