Skip to content

Conversation

Atry
Copy link
Contributor

@Atry Atry commented Dec 19, 2021

No description provided.

@dwijnand
Copy link
Member

I think we should mark this as @experimental, that way we can decide later if we want to commit to having it.

* to an expression equivalent to
* `'{ $a => $r }` typed as an `Expr[A => R]`
*/
def ofFunction1[A, R](f: Expr[A] => Expr[R])(using Type[R], Type[A])(using Quotes): Expr[A => R] =
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we add this we should add it for all function arities. It seems that we would need TupledFunction (see #10416) to be able to write this interface for all function sizes.

* Transforms the expression
* `a => r` where `a: Expr[A]` and `r: Expr[R]`
* to an expression equivalent to
* `'{ $a => $r }` typed as an `Expr[A => R]`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As you're adding a new method to stdlib's API you should mark it as@experimental

@nicolasstucki
Copy link
Contributor

We will not be able to advance on this before we have #14414. I will close this PR for now. We should revisit it once we have #14414.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants