Skip to content

Commit d4e53c8

Browse files
authored
Update README.md
Add info about Scala 3
1 parent 54a8315 commit d4e53c8

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

README.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,21 @@
55

66
A Scala compiler plugin to give patterns and for-comprehensions the love they deserve
77

8+
## Note on Scala 3
9+
Scala 3.0.0 natively supports the semantic changes provided by better-monadic-for under `-source:future` compiler flag. The following code is considered valid under this flag:
10+
11+
```scala
12+
for {
13+
(x, given String) <- IO(42 -> "foo")
14+
} yield s"$x${summon[String]}"
15+
```
16+
17+
There are no changes to `map` desugaring and value bindings inside fors still allocate tuples to my current knowledge. I don't currently have plans on rewriting plugin for Scala 3, however.
18+
19+
See [changes: pattern bindings](https://dotty.epfl.ch/docs/reference/changed-features/pattern-bindings.html) and [contextual abstractions: pattern-bound given instances](https://dotty.epfl.ch/docs/reference/contextual/givens.html#pattern-bound-given-instances).
20+
21+
---
22+
823
## Getting started
924
The plugin is available on Maven Central.
1025

0 commit comments

Comments
 (0)