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
Copy file name to clipboardExpand all lines: docs/_docs/reference/experimental/better-fors.md
+1-1
Original file line number
Diff line number
Diff line change
@@ -60,7 +60,7 @@ Additionally this extension changes the way `for`-comprehensions are desugared.
60
60
This change makes the desugaring more intuitive and avoids unnecessary `map` calls, when an alias is not followed by a guard.
61
61
62
62
2. **AvoidingRedundant `map` Calls**:
63
-
When the result of the `for`-comprehension is the same expression asthe last generator pattern, the desugaring avoids an unnecessary `map` call. but th eequality of the last pattern and the result has to be able to be checked syntactically, so it is either a variable or a tuple of variables.
63
+
When the result of the `for`-comprehension is the same expression asthe last generator pattern, the desugaring avoids an unnecessary `map` call. But the equality of the last pattern and the result has to be able to be checked syntactically, so it is either a variable or a tuple of variables. There is also a special casefor dropping the `map`, if its body is a constant function, that returns `()` (`Unit` constant).
0 commit comments