File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed
docs/docs/reference/metaprogramming Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -135,24 +135,24 @@ expressiveness.
135
135
136
136
### From ` Expr ` s to Functions and Back
137
137
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
139
139
describing a function into a function mapping trees to trees.
140
140
``` scala
141
141
object Expr {
142
142
...
143
- implied AsFunction1 [ T , U ] for Conversion [ Expr [ T => U ], Expr [ T ] => Expr [ U ]] ...
143
+ implicit class FunctionBetaReduction [...](...) { ... }
144
144
}
145
145
```
146
146
This decorator gives ` Expr ` the ` apply ` operation of an applicative functor, where ` Expr ` s
147
147
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
149
149
` '{($f)($x)} ` , however it should optimize this call by returning the
150
150
result of beta-reducing ` f(x) ` if ` f ` is a known lambda expression.
151
151
152
- The ` AsFunction1 ` decorator distributes applications of ` Expr ` over function
152
+ The ` FunctionBetaReduction ` decorator distributes applications of ` Expr ` over function
153
153
arrows:
154
154
``` scala
155
- AsFunction1 (_ ).apply: Expr [S => T ] => (Expr [S ] => Expr [T ])
155
+ FunctionBetaReduction (f ).apply: Expr [S => T ] => (Expr [S ] => Expr [T ])
156
156
```
157
157
Its dual, let’s call it ` reflect ` , can be defined as follows:
158
158
``` scala
You can’t perform that action at this time.
0 commit comments