Skip to content

Commit ea8f903

Browse files
Merge pull request #68 from laverboy/patch-1
few text tweaks
2 parents e9d49c8 + 6ff6b3f commit ea8f903

File tree

3 files changed

+8
-8
lines changed

3 files changed

+8
-8
lines changed

src/main/scala/stdlib/Classes.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@ object Classes extends FlatSpec with Matchers with org.scalaexercises.definition
2929
* }
3030
* }}}
3131
*
32-
* The program defines an executable application `Classes` in form of a top-level singleton object with a `main` method. The `main` method creates a new `Point` and stores it in value `pt`.
32+
* The program defines an executable application `Classes` in the form of a top-level singleton object with a `main` method. The `main` method creates a new `Point` and stores it in value `pt`.
3333
*
34-
* This also demonstrates the use of a value parameters in ClassWithValParameter(val name: String), which automatically creates an internal property (val name: String) in the class.
34+
* This also demonstrates the use of value parameters in ClassWithValParameter(val name: String), which automatically creates an internal property (val name: String) in the class.
3535
*
3636
*/
3737
def classWithValParameterClasses(res0: String) {

src/main/scala/stdlib/HigherOrderFunctions.scala

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ object HigherOrderFunctions extends FlatSpec with Matchers with org.scalaexercis
99

1010
/** Meet lambda. Scala provides a relatively lightweight syntax for defining anonymous functions. Anonymous functions in source code are called function literals and at run time, function literals are instantiated into objects called function values.
1111
*
12-
* Scala supports first-class functions, which means you can express functions in function literal syntax, i.e.,` (x: Int) => x + 1`, and that functions can be represented by objects, which are called function values.
12+
* Scala supports first-class functions, which means you can express functions in function literal syntax, i.e.,` (x: Int) => x + 1`, and those functions can be represented by objects, which are called function values.
1313
*/
1414
def meetLambdaHigherOrderFunctions(res0: Int, res1: Int, res2: Int, res3: Int, res4: Int, res5: Int) {
1515
def lambda = { x: Int x + 1 }
@@ -68,7 +68,7 @@ object HigherOrderFunctions extends FlatSpec with Matchers with org.scalaexercis
6868
result2 should be(res1)
6969
}
7070

71-
/** We can take that closure and throw into a method and it will still hold the environment
71+
/** We can take that closure and throw it into a method and it will still hold the environment
7272
*/
7373
def holdEnvironmentHigherOrderFunctions(res0: Int, res1: Int) {
7474
def summation(x: Int, y: Int Int) = y(x)
@@ -113,15 +113,15 @@ object HigherOrderFunctions extends FlatSpec with Matchers with org.scalaexercis
113113
fiveAdder(5) should be(res2)
114114
}
115115

116-
/** `isInstanceOf` is the same as `instanceof` in java, but in this case the parameter types can be *blanked out* using existential types with a single underline, since parameter type are unknown at runtime.
116+
/** `isInstanceOf` is the same as `instanceof` in java, but in this case the parameter types can be *blanked out* using existential types with a single underline, since parameter types are unknown at runtime.
117117
*/
118118
def isInstanceOfMethodHigherOrderFunctions(res0: Boolean) {
119119
def addWithSyntaxSugar(x: Int) = (y: Int) x + y
120120

121121
addWithSyntaxSugar(1).isInstanceOf[Function1[_, _]] should be(res0)
122122
}
123123

124-
/** Function taking another function as parameter. Helps in composing functions.
124+
/** Function taking another function as a parameter. Helps in composing functions.
125125
*
126126
* Hint: a map method applies the function to each element of a list
127127
*/

src/main/scala/stdlib/Options.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ object Options extends FlatSpec with Matchers with org.scalaexercises.definition
7474
/** An alternative for pattern matching is performing collection style operations.
7575
* This is possible because an option could be looked at as a collection with either one or zero elements.
7676
*
77-
* One of these operations is `map`. this operation allows to map the inner value to a different type while preserving the option
77+
* One of these operations is `map`. This operation allows us to map the inner value to a different type while preserving the option
7878
*/
7979
def mapOptions(res0: Option[Double], res1: Option[Double]) {
8080
val number: Option[Int] = Some(3)
@@ -88,7 +88,7 @@ object Options extends FlatSpec with Matchers with org.scalaexercises.definition
8888
/** Note that the type of result1 is now Option[Double], thanks to the scala type inference. */
8989
}
9090

91-
/** Another operation is `fold`. this operation will extract the value from the option, or provide a default if the value is `None`
91+
/** Another operation is `fold`. This operation will extract the value from the option, or provide a default if the value is `None`
9292
*/
9393
def foldOptions(res0: Int, res1: Int) {
9494
val number: Option[Int] = Some(3)

0 commit comments

Comments
 (0)