Skip to content

Commit 86d1f36

Browse files
authored
Fixing typos and making a sentence clearer
The sentence used to say "One difference with Try is that you can choose another type than Throwable to represent the exception," which makes it sound like you can choose types other than Throwable with Try when it is really talking about Either.
1 parent ae75b16 commit 86d1f36

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/main/scala/scalatutorial/sections/StandardLibrary.scala

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ object StandardLibrary extends ScalaTutorialSection {
235235
* - or a `Failure`.
236236
*
237237
* The key difference between `None` and `Failure`s is that the latter provide
238-
* the reason of the failure:
238+
* the reason for the failure:
239239
*
240240
* {{{
241241
* def sqrt(x: Double): Try[Double] =
@@ -249,7 +249,7 @@ object StandardLibrary extends ScalaTutorialSection {
249249
* be decomposed using pattern matching.
250250
*
251251
* `Try[A]` also have `map`, `filter` and `flatMap`. They behave the same
252-
* as with `Option[A]`, excepted that any exception that is thrown
252+
* as with `Option[A]`, except that any exception that is thrown
253253
* during their execution is converted into a `Failure`.
254254
*
255255
* == Either ==
@@ -259,8 +259,8 @@ object StandardLibrary extends ScalaTutorialSection {
259259
* of type `B`. It can be decomposed in two cases: `Left` or `Right`.
260260
*
261261
* You can use one case to represent the failure and the other to represent
262-
* the success. One difference with `Try` is that you can choose another
263-
* type than `Throwable` to represent the exception. Another difference
262+
* the success. What makes it different from `Try` is that you can choose a
263+
* type other than `Throwable` to represent the exception. Another difference
264264
* is that exceptions that occur when transforming `Either` values are
265265
* not converted into failures.
266266
*

0 commit comments

Comments
 (0)