Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Redefine quoted.Expr.betaReduce #9469

Merged

Commits on Jul 30, 2020

  1. Redefine quoted.Expr.betaReduce

    Redefine `quoted.Expr.betaRduce` to not rely on complex type level computations.
    Changed the signature as follows
    ```diff
    - 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 = ...
    + def betaReduce[T](expr: Expr[T])(using qctx: QuoteContext): Expr[T] = ...
    ```
    
    Improvements
    * Simpler API that covers all kind of functions at once (normal/given/erased)
    * Better error message for ill-typed `betaRduce` calls
    * Adds the possiblility of knowing if the beta-reeduction suceeded
    * Use `transform.BetaReduce`
    * Improve `transform.BetaReduce` to handle `Inlined` trees and constant argumets
    * Fixes scala#9466
    
    Drawback
    * Need for slightly loneger code (previous interface could be implented on top of this one)
    nicolasstucki committed Jul 30, 2020
    Copy the full SHA
    78f6ee4 View commit details
    Browse the repository at this point in the history

Commits on Aug 3, 2020

  1. Update library/src-bootstrapped/scala/quoted/Expr.scala

    Co-authored-by: Fengyun Liu <liu@fengy.me>
    nicolasstucki and liufengyun committed Aug 3, 2020
    Copy the full SHA
    354a0f1 View commit details
    Browse the repository at this point in the history