Skip to content

Commit e470404

Browse files
committed
Fixed typos, added commas
1 parent 5e87425 commit e470404

File tree

95 files changed

+283
-283
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

95 files changed

+283
-283
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ Please have a look at [Add New Guides/Tutorials](https://docs.scala-lang.org/con
3131
This document gives an overview of the type of documentation contained within the Scala Documentation repository and the repository's structure.
3232

3333
Small changes, or corrected typos will generally be pulled in right away. Large changes, like the addition of new documents, or the rewriting of
34-
existing documents will be thoroughly reviewed-- please keep in mind that, generally, new documents must be very well-polished, complete, and maintained
34+
existing documents will be thoroughly reviewed-- please keep in mind that, mostly, new documents must be very well-polished, complete, and maintained
3535
in order to be accepted.
3636

3737
## Dependencies ##

_contribute_resources/2-bug-fixes.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,6 @@ title: Bug fixes
33
link: /contribute/guide.html
44
icon: fa fa-bug
55
---
6-
Issues with the tools, core libraries and compiler. Also you can help us by [reporting bugs][bug-reporting-guide].
6+
Issues with the tools, core libraries and compiler. Also, you can help us by [reporting bugs][bug-reporting-guide].
77

88
[bug-reporting-guide]: {% link _overviews/contribute/bug-reporting-guide.md %}

_getting-started/intellij-track/getting-started-with-scala-in-intellij.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ you'll need to install a Scala SDK. To the right of the Scala SDK field,
3434
click the **Create** button.
3535
1. Select the highest version number (e.g. {{ site.scala-version }}) and click **Download**. This might
3636
take a few minutes but subsequent projects can use the same SDK.
37-
1. Once the SDK is created and you're back to the "New Project" window click **Finish**.
37+
1. Once the SDK is created, and you're back to the "New Project" window click **Finish**.
3838

3939

4040
## Writing code
@@ -69,7 +69,7 @@ square(2)
6969
```
7070

7171
As you change your code, you'll notice that it gets evaluated
72-
in the right pane. If you do not see a right pane, right click on your Scala worksheet in the Project pane, and click on Evaluate Worksheet.
72+
in the right pane. If you do not see a right pane, right-click on your Scala worksheet in the Project pane, and click on Evaluate Worksheet.
7373

7474
## Next Steps
7575

_getting-started/intellij-track/testing-scala-in-intellij-with-scalatest.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ called [FunSuite](https://www.scalatest.org/getting_started_with_fun_suite).
1616
This assumes you know [how to build a project in IntelliJ](building-a-scala-project-with-intellij-and-sbt.html).
1717

1818
## Setup
19-
1. Create an sbt project in IntelliJ.
19+
1. Create a sbt project in IntelliJ.
2020
1. Add the ScalaTest dependency:
2121
1. Add the ScalaTest dependency to your `build.sbt` file:
2222
```
@@ -28,7 +28,7 @@ This assumes you know [how to build a project in IntelliJ](building-a-scala-proj
2828
unrecognized.
2929
1. On the project pane on the left, expand `src` => `main`.
3030
1. Right-click on `scala` and select **New** => **Scala class**.
31-
1. Call it `CubeCalculator`, change the **Kind** to `object`, and hit enter or double click on `object`.
31+
1. Call it `CubeCalculator`, change the **Kind** to `object`, and hit enter or double-click on `object`.
3232
1. Replace the code with the following:
3333
```
3434
object CubeCalculator extends App {
@@ -41,7 +41,7 @@ This assumes you know [how to build a project in IntelliJ](building-a-scala-proj
4141
## Creating a test
4242
1. On the project pane on the left, expand `src` => `test`.
4343
1. Right-click on `scala` and select **New** => **Scala class**.
44-
1. Name the class `CubeCalculatorTest` and hit enter or double click on `class`.
44+
1. Name the class `CubeCalculatorTest` and hit enter or double-click on `class`.
4545
1. Replace the code with the following:
4646
```
4747
import org.scalatest.funsuite.AnyFunSuite

_glossary/index.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ You can assign an object to a variable. Afterwards, the variable will refer to t
4444
Extra constructors defined inside the curly braces of the class definition, which look like method definitions named `this`, but with no result type.
4545

4646
* #### block
47-
One or more expressions and declarations surrounded by curly braces. When the block evaluates, all of its expressions and declarations are processed in order, and then the block returns the value of the last expression as its own value. Blocks are commonly used as the bodies of functions, [for expressions](#for-expression), `while` loops, and any other place where you want to group a number of statements together. More formally, a block is an encapsulation construct for which you can only see side effects and a result value. The curly braces in which you define a class or object do not, therefore, form a block, because fields and methods (which are defined inside those curly braces) are visible from the out- side. Such curly braces form a template.
47+
One or more expressions and declarations surrounded by curly braces. When the block evaluates, all of its expressions and declarations are processed in order, and then the block returns the value of the last expression as its own value. Blocks are commonly used as the bodies of functions, [for expressions](#for-expression), `while` loops, and any other place where you want to group a number of statements together. More formally, a block is an encapsulation construct for which you can only see side effects and a result value. The curly braces in which you define a class or object do not, therefore, form a block, because fields and methods (which are defined inside those curly braces) are visible from the out-side. Such curly braces form a template.
4848

4949
* #### bound variable
5050
A bound variable of an expression is a variable that’s both used and defined inside the expression. For instance, in the function literal expression `(x: Int) => (x, y)`, both variables `x` and `y` are used, but only `x` is bound, because it is defined in the expression as an `Int` and the sole argument to the function described by the expression.
@@ -68,10 +68,10 @@ A class that shares the same name with a singleton object defined in the same so
6868
A singleton object that shares the same name with a class defined in the same source file. Companion objects and classes have access to each other’s private members. In addition, any implicit conversions defined in the companion object will be in scope anywhere the class is used.
6969

7070
* #### contravariant
71-
A _contravariant_ annotation can be applied to a type parameter of a class or trait by putting a minus sign (-) before the type parameter. The class or trait then subtypes contravariantly with—in the opposite direction as—the type annotated parameter. For example, `Function1` is contravariant in its first type parameter, and so `Function1[Any, Any]` is a subtype of `Function1[String, Any]`.
71+
A _contravariant_ annotation can be applied to a type parameter of a class or trait by putting a minus sign (-) before the type parameter. The class or trait then subtypes contravariant with—in the opposite direction as—the type annotated parameter. For example, `Function1` is contravariant in its first type parameter, and so `Function1[Any, Any]` is a subtype of `Function1[String, Any]`.
7272

7373
* #### covariant
74-
A _covariant_ annotation can be applied to a type parameter of a class or trait by putting a plus sign (+) before the type parameter. The class or trait then subtypes covariantly with—in the same direction as—the type annotated parameter. For example, `List` is covariant in its type parameter, so `List[String]` is a subtype of `List[Any]`.
74+
A _covariant_ annotation can be applied to a type parameter of a class or trait by putting a plus sign (+) before the type parameter. The class or trait then subtypes covariant with—in the same direction as—the type annotated parameter. For example, `List` is covariant in its type parameter, so `List[String]` is a subtype of `List[Any]`.
7575

7676
* #### currying
7777
A way to write functions with multiple parameter lists. For instance `def f(x: Int)(y: Int)` is a curried function with two parameter lists. A curried function is applied by passing several arguments lists, as in: `f(3)(4)`. However, it is also possible to write a _partial application_ of a curried function, such as `f(3)`.
@@ -284,7 +284,7 @@ A function in a Scala program _returns_ a value. You can call this value the [re
284284
The Java Virtual Machine, or [JVM](#jvm), that hosts a running Scala program. Runtime encompasses both the virtual machine, as defined by the Java Virtual Machine Specification, and the runtime libraries of the Java API and the standard Scala API. The phrase at run time (with a space between run and time) means when the program is running, and contrasts with compile time.
285285

286286
* #### runtime type
287-
The type of an object at run time. To contrast, a [static type](#static-type) is the type of an expression at compile time. Most runtime types are simply bare classes with no type parameters. For example, the runtime type of `"Hi"` is `String`, and the runtime type of `(x: Int) => x + 1` is `Function1`. Runtime types can be tested with `isInstanceOf`.
287+
The type of object at run time. To contrast, a [static type](#static-type) is the type of expression at compile time. Most runtime types are simply bare classes with no type parameters. For example, the runtime type of `"Hi"` is `String`, and the runtime type of `(x: Int) => x + 1` is `Function1`. Runtime types can be tested with `isInstanceOf`.
288288

289289
* #### script
290290
A file containing top level definitions and statements, which can be run directly with `scala` without explicitly compiling. A script must end in an expression, not a definition.
@@ -293,13 +293,13 @@ A file containing top level definitions and statements, which can be run directl
293293
The value being matched on in a `match` expression. For example, in “`s match { case _ => }`”, the selector is `s`.
294294

295295
* #### self type
296-
A _self type_ of a trait is the assumed type of `this`, the receiver, to be used within the trait. Any concrete class that mixes in the trait must ensure that its type conforms to the trait’s self type. The most common use of self types is for dividing a large class into several traits (as described in Chapter 29 of [Programming in Scala](https://www.artima.com/shop/programming_in_scala)).
296+
A _self type_ of trait is the assumed type of `this`, the receiver, to be used within the trait. Any concrete class that mixes in the trait must ensure that its type conforms to the trait’s self type. The most common use of self types is for dividing a large class into several traits (as described in Chapter 29 of [Programming in Scala](https://www.artima.com/shop/programming_in_scala)).
297297

298298
* #### semi-structured data
299299
XML data is semi-structured. It is more structured than a flat binary file or text file, but it does not have the full structure of a programming language’s data structures.
300300

301301
* #### serialization
302-
You can _serialize_ an object into a byte stream which can then be saved to files or transmitted over the network. You can later _deserialize_ the byte stream, even on different computer, and obtain an object that is the same as the original serialized object.
302+
You can _serialize_ an object into a byte stream which can then be saved to file or transmitted over the network. You can later _deserialize_ the byte stream, even on different computer, and obtain an object that is the same as the original serialized object.
303303

304304
* #### shadow
305305
A new declaration of a local variable _shadows_ one of the same name in an enclosing scope.
@@ -308,7 +308,7 @@ A new declaration of a local variable _shadows_ one of the same name in an enclo
308308
_Signature_ is short for [type signature](#type-signature).
309309

310310
* #### singleton object
311-
An object defined with the object keyword. Each singleton object has one and only one instance. A singleton object that shares its name with a class, and is defined in the same source file as that class, is that class’s [companion object](#companion-object). The class is its [companion class](#companion-class). A singleton object that doesnt have a companion class is a [standalone object](#standalone-object).
311+
An object defined with the object keyword. Each singleton object has one and only one instance. A singleton object that shares its name with a class, and is defined in the same source file as that class, is that class’s [companion object](#companion-object). The class is its [companion class](#companion-class). A singleton object that doesn't have a companion class is a [standalone object](#standalone-object).
312312

313313
* #### standalone object
314314
A [singleton object](#singleton-object) that has no [companion class](#companion-class).

_overviews/FAQ/index.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ fatal.
8282
opinionated sbt plugin that sets many options automatically, depending
8383
on Scala version; you can see
8484
[here](https://github.com/DavidGregory084/sbt-tpolecat/blob/master/src/main/scala/io/github/davidgregory084/TpolecatPlugin.scala)
85-
what it sets. Some of the choices it makes are oriented towards
85+
what it sets. Some choices it makes are oriented towards
8686
pure-functional programmers.
8787

8888
### How do I find what some symbol means or does?
@@ -197,7 +197,7 @@ So for example, a `List[Int]` in Scala code will appear to Java as a
197197
appear as type parameters, but couldn't they appear as their boxed
198198
equivalents, such as `List[java.lang.Integer]`?
199199

200-
One would hope so, but doing it that way was tried and it proved impossible.
200+
One would hope so, but doing it that way was tried, and it proved impossible.
201201
[This SO question](https://stackoverflow.com/questions/11167430/why-are-primitive-types-such-as-int-erased-to-object-in-scala)
202202
sadly lacks a concise explanation, but it does link to past discussions.
203203

_overviews/FAQ/initialization-order.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@ Usually the best answer. Unfortunately you cannot declare an abstract lazy val.
9494
2. Declare an abstract def, and hope subclasses will implement it as a lazy val. If they do not, it will be re-evaluated on every access.
9595
3. Declare a concrete lazy val which throws an exception, and hope subclasses override it. If they do not, it will... throw an exception.
9696

97-
An exception during initialization of a lazy val will cause the right hand side to be re-evaluated on the next access: see SLS 5.2.
97+
An exception during initialization of a lazy val will cause the right-hand side to be re-evaluated on the next access: see SLS 5.2.
9898

9999
Note that using multiple lazy vals creates a new risk: cycles among lazy vals can result in a stack overflow on first access.
100100

0 commit comments

Comments
 (0)