@@ -60,10 +60,8 @@ object Expr {
6060 * Expr.betaReduce(_): Expr[(T1, ..., Tn) => R] => ((Expr[T1], ..., Expr[Tn]) => Expr[R])
6161 * ```
6262 */
63- def betaReduce [F , Args <: Tuple , R , G ](f : Expr [F ])(using tf : TupledFunction [F , Args => R ], tg : TupledFunction [G , TupleOfExpr [Args ] => Expr [R ]], qctx : QuoteContext ): G = {
64- import qctx .tasty ._
63+ def betaReduce [F , Args <: Tuple , R , G ](f : Expr [F ])(using tf : TupledFunction [F , Args => R ], tg : TupledFunction [G , TupleOfExpr [Args ] => Expr [R ]], qctx : QuoteContext ): G =
6564 tg.untupled(args => qctx.tasty.internal.betaReduce(f.unseal, args.toArray.toList.map(_.asInstanceOf [QuoteContext => Expr [_]](qctx).unseal)).seal.asInstanceOf [Expr [R ]])
66- }
6765
6866 /** `Expr.betaReduceGiven(f)(x1, ..., xn)` is functionally the same as `'{($f)(using $x1, ..., $xn)}`, however it optimizes this call
6967 * by returning the result of beta-reducing `f(using x1, ..., xn)` if `f` is a known lambda expression.
@@ -73,10 +71,8 @@ object Expr {
7371 * Expr.betaReduceGiven(_): Expr[(T1, ..., Tn) ?=> R] => ((Expr[T1], ..., Expr[Tn]) => Expr[R])
7472 * ```
7573 */
76- def betaReduceGiven [F , Args <: Tuple , R , G ](f : Expr [F ])(using tf : TupledFunction [F , Args ?=> R ], tg : TupledFunction [G , TupleOfExpr [Args ] => Expr [R ]], qctx : QuoteContext ): G = {
77- import qctx .tasty ._
74+ def betaReduceGiven [F , Args <: Tuple , R , G ](f : Expr [F ])(using tf : TupledFunction [F , Args ?=> R ], tg : TupledFunction [G , TupleOfExpr [Args ] => Expr [R ]], qctx : QuoteContext ): G =
7875 tg.untupled(args => qctx.tasty.internal.betaReduce(f.unseal, args.toArray.toList.map(_.asInstanceOf [QuoteContext => Expr [_]](qctx).unseal)).seal.asInstanceOf [Expr [R ]])
79- }
8076
8177 /** Returns a null expresssion equivalent to `'{null}` */
8278 def nullExpr : QuoteContext ?=> Expr [Null ] = qctx ?=> {
@@ -184,7 +180,6 @@ object Expr {
184180
185181 /** Given a tuple of the form `(Expr[A1], ..., Expr[An])`, outputs a tuple `Expr[(A1, ..., An)]`. */
186182 def ofTuple [T <: Tuple : Tuple .IsMappedBy [Expr ]: Type ](tup : T )(using qctx : QuoteContext ): Expr [Tuple .InverseMap [T , Expr ]] = {
187- import qctx .tasty ._
188183 val elems : Seq [Expr [_]] = tup.asInstanceOf [Product ].productIterator.toSeq.asInstanceOf [Seq [Expr [_]]]
189184 ofTuple(elems).cast[Tuple .InverseMap [T , Expr ]]
190185 }
0 commit comments