You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Here, the body of `test` is a lambda that refers to the capability `fs`, which means that `fs` is retained in the lambda.
261
-
Consequently, the type of the lambda is `{fs} String => Unit`.
261
+
Consequently, the type of the lambda is `{fs} String -> Unit`.
262
262
263
263
**Note:** Function values are always written with `=>` (or `?=>` for context functions). There is no syntactic
264
264
distinction for pure _vs_ impure function values. The distinction is only made in their types.
@@ -271,8 +271,7 @@ def test(fs: FileSystem) =
271
271
defg() = (x: String) =>Logger(fs).log(x)
272
272
f
273
273
```
274
-
the result of `test` has type `{fs} String => Unit` even though function `f`
275
-
itself does not refer to `fs`.
274
+
the result of `test` has type `{fs} String -> Unit` even though function `f` itself does not refer to `fs`.
276
275
277
276
## Capture Checking of Classes
278
277
@@ -438,7 +437,7 @@ is OK. But at the point of use, it is `*` (because `f` is no longer in scope), w
438
437
439
438
Looking at object graphs, we observe a monotonicity property: The capture set of an object `x` covers the capture sets of all objects reachable through `x`. This property is reflected in the type system by the following _monotonicity rule_:
440
439
441
-
- In a class `C` with a field `f`, the capture set `{this}` covers the capture set `{this.f}` as well as any application of the latter set to pure arguments.
440
+
- In a class `C` with a field `f`, the capture set `{this}` covers the capture set `{this.f}` as well as the capture set of any application of `this.f` to pure arguments.
0 commit comments