Skip to content

Commit e2546fc

Browse files
committed
Update documentation
1 parent 89be7da commit e2546fc

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

docs/docs/reference/metaprogramming/macros.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -135,24 +135,24 @@ expressiveness.
135135

136136
### From `Expr`s to Functions and Back
137137

138-
The `Expr` companion object contains an implicit `AsFunctionN` (for 0 <= N < 23) conversion that turns a tree
138+
The `Expr` companion object contains an implicit `FunctionBetaReduction` conversion that turns a tree
139139
describing a function into a function mapping trees to trees.
140140
```scala
141141
object Expr {
142142
...
143-
implied AsFunction1[T, U] for Conversion[Expr[T => U], Expr[T] => Expr[U]] ...
143+
implicit class FunctionBetaReduction[...](...) { ... }
144144
}
145145
```
146146
This decorator gives `Expr` the `apply` operation of an applicative functor, where `Expr`s
147147
over function types can be applied to `Expr` arguments. The definition
148-
of `AsFunction1(f).apply(x)` is assumed to be functionally the same as
148+
of `FunctionBetaReduction(f).apply(x)` is assumed to be functionally the same as
149149
`'{($f)($x)}`, however it should optimize this call by returning the
150150
result of beta-reducing `f(x)` if `f` is a known lambda expression.
151151

152-
The `AsFunction1` decorator distributes applications of `Expr` over function
152+
The `FunctionBetaReduction` decorator distributes applications of `Expr` over function
153153
arrows:
154154
```scala
155-
AsFunction1(_).apply: Expr[S => T] => (Expr[S] => Expr[T])
155+
FunctionBetaReduction(f).apply: Expr[S => T] => (Expr[S] => Expr[T])
156156
```
157157
Its dual, let’s call it `reflect`, can be defined as follows:
158158
```scala

0 commit comments

Comments
 (0)