Skip to content

Commit 87de2c9

Browse files
committed
Address @propensive comments
1 parent 1d6ccd7 commit 87de2c9

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

_posts/2020-10-21-explicit-term-inference-in-scala-3.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,17 +8,17 @@ title: Explicit term inference with Scala 3
88
# Explicit term inference with Scala 3
99

1010
One of the most striking changes for developers adopting Scala 3 is the introduction
11-
of new syntaxes to replace the implicit mechanism used in previous Scala versions.
11+
of a new syntax to replace the implicit mechanism used in previous Scala versions.
1212

1313
The motivation behind the new syntax is that the same `implicit` keyword was
1414
used for different purposes and patterns and thus it became a way to express *how* to implement
1515
patterns. This means that when encountering this ambiguous incantation, users need to decipher what
16-
the intent of the developer was: is this a conversion ? Does this avoid parameter repetition ?
17-
Is this an extension of a type ? Is this a typeclass ? How do I import this ?
16+
the intent of the developer was: is this a conversion? Does this avoid parameter repetition?
17+
Is this an extension of a type? Is this a typeclass? How do I import this?
1818

1919
Seeing how pervasive implicits became in libraries and projects, Scala 3 aims at reducing confusion and cognitive load by using new keywords that convey the intent of the developer.
2020

21-
This post briefly introduces the new syntaxes and semantics available to Scala 3 programmers by analysing the
21+
This post briefly introduces the new syntax and semantics available to Scala 3 programmers by analysing the
2222
most common use cases and patterns: extension methods, implicit parameters, implicit conversions and typeclasses.
2323

2424
## Compatibility disclaimer
@@ -103,7 +103,7 @@ add a couple of methods to `List[Try[A]]`.
103103
### Find out more
104104

105105
You can find more information about extension methods on [the dedicated documentation page](http://dotty.epfl.ch/docs/reference/contextual/extension-methods.html).
106-
I also suggest that you read how they complement another new Scala 3 feature: [opaque types](https://dotty.epfl.ch/docs/reference/other-new-features/opaques.html).
106+
We also suggest that you read how they complement another new Scala 3 feature: [opaque types](https://dotty.epfl.ch/docs/reference/other-new-features/opaques.html).
107107
Later in this post we will see how they simplify a very common pattern: typeclasses.
108108

109109
## Avoiding repetition with contextual parameters
@@ -196,7 +196,7 @@ import Context.given
196196
```
197197
Or by making the type that you are bringing in scope explicit:
198198
```
199-
Import Context.{given ExecutionContext}
199+
import Context.{given ExecutionContext}
200200
```
201201
This allows you to have more control over imports without relying on instance names.
202202

@@ -349,7 +349,7 @@ import Show.{_, given}
349349
case class Mountain(name: String, height: Int)
350350

351351
given Show[Mountain] =
352-
Show.from((m: Mountain) => s"The ${m.name} is ${m.height} meters high")
352+
Show.from((m: Mountain) => s"${m.name} is ${m.height} meters high")
353353

354354
@main def main =
355355
val mountains = List(Mountain("Mont Blanc", 4808), Mountain("Matterhorn", 4478))
@@ -406,7 +406,7 @@ object Main extends App {
406406
println(mountains.show)
407407
}
408408
```
409-
I believe that this example shows how `implicit` was used to achieve different goals
409+
We believe that this example shows how `implicit` was used to achieve different goals
410410
and, in doing so, used to be more confusing:
411411
- if you need to add methods, use `extension` rather than an implicit class
412412
- If you need an implicit parameters, use `using` to declare what you will need

0 commit comments

Comments
 (0)