@@ -28,29 +28,29 @@ package quoted {
2828 /** Converts a tuple `(T1, ..., Tn)` to `(Expr[T1], ..., Expr[Tn])` */
2929 type TupleOfExpr [Tup <: Tuple ] = Tuple .Map [Tup , [X ] =>> (given QuoteContext ) => Expr [X ]]
3030
31- /** `Expr.reduce (f)(x1, ..., xn)` is functionally the same as `'{($f)($x1, ..., $xn)}`, however it optimizes this call
31+ /** `Expr.betaReduce (f)(x1, ..., xn)` is functionally the same as `'{($f)($x1, ..., $xn)}`, however it optimizes this call
3232 * by returning the result of beta-reducing `f(x1, ..., xn)` if `f` is a known lambda expression.
3333 *
34- * `Expr.reduce ` distributes applications of `Expr` over function arrows
34+ * `Expr.betaReduce ` distributes applications of `Expr` over function arrows
3535 * ```scala
36- * Expr.reduce (_): Expr[(T1, ..., Tn) => R] => ((Expr[T1], ..., Expr[Tn]) => Expr[R])
36+ * Expr.betaReduce (_): Expr[(T1, ..., Tn) => R] => ((Expr[T1], ..., Expr[Tn]) => Expr[R])
3737 * ```
3838 */
39- def reduce [F , Args <: Tuple , R , G ](f : Expr [F ])(given tf : TupledFunction [F , Args => R ], tg : TupledFunction [G , TupleOfExpr [Args ] => Expr [R ]], qctx : QuoteContext ): G = {
39+ def betaReduce [F , Args <: Tuple , R , G ](f : Expr [F ])(given tf : TupledFunction [F , Args => R ], tg : TupledFunction [G , TupleOfExpr [Args ] => Expr [R ]], qctx : QuoteContext ): G = {
4040 import qctx .tasty ._
4141 tg.untupled(args => qctx.tasty.internal.betaReduce(f.unseal, args.toArray.toList.map(_.asInstanceOf [QuoteContext => Expr [_]](qctx).unseal)).seal.asInstanceOf [Expr [R ]])
4242 }
4343
44- /** `Expr.reduceGiven (f)(x1, ..., xn)` is functionally the same as `'{($f)(given $x1, ..., $xn)}`, however it optimizes this call
44+ /** `Expr.betaReduceGiven (f)(x1, ..., xn)` is functionally the same as `'{($f)(given $x1, ..., $xn)}`, however it optimizes this call
4545 * by returning the result of beta-reducing `f(given x1, ..., xn)` if `f` is a known lambda expression.
4646 *
47- * `Expr.reduceGiven ` distributes applications of `Expr` over function arrows
47+ * `Expr.betaReduceGiven ` distributes applications of `Expr` over function arrows
4848 * ```scala
49- * Expr.reduceGiven (_): Expr[(given T1, ..., Tn) => R] => ((Expr[T1], ..., Expr[Tn]) => Expr[R])
49+ * Expr.betaReduceGiven (_): Expr[(given T1, ..., Tn) => R] => ((Expr[T1], ..., Expr[Tn]) => Expr[R])
5050 * ```
51- * Note: The
51+ * Note: The
5252 */
53- def reduceGiven [F , Args <: Tuple , R , G ](f : Expr [F ])(given tf : TupledFunction [F , (given Args ) => R ], tg : TupledFunction [G , TupleOfExpr [Args ] => Expr [R ]], qctx : QuoteContext ): G = {
53+ def betaReduceGiven [F , Args <: Tuple , R , G ](f : Expr [F ])(given tf : TupledFunction [F , (given Args ) => R ], tg : TupledFunction [G , TupleOfExpr [Args ] => Expr [R ]], qctx : QuoteContext ): G = {
5454 import qctx .tasty ._
5555 tg.untupled(args => qctx.tasty.internal.betaReduce(f.unseal, args.toArray.toList.map(_.asInstanceOf [QuoteContext => Expr [_]](qctx).unseal)).seal.asInstanceOf [Expr [R ]])
5656 }
0 commit comments