diff --git a/src/main/scala/stdlib/Classes.scala b/src/main/scala/stdlib/Classes.scala index fd6a89cf..0b001203 100644 --- a/src/main/scala/stdlib/Classes.scala +++ b/src/main/scala/stdlib/Classes.scala @@ -29,9 +29,9 @@ object Classes extends FlatSpec with Matchers with org.scalaexercises.definition * } * }}} * - * 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`. + * 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`. * - * 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. + * 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. * */ def classWithValParameterClasses(res0: String) { diff --git a/src/main/scala/stdlib/HigherOrderFunctions.scala b/src/main/scala/stdlib/HigherOrderFunctions.scala index 894ebd6d..47115584 100644 --- a/src/main/scala/stdlib/HigherOrderFunctions.scala +++ b/src/main/scala/stdlib/HigherOrderFunctions.scala @@ -9,7 +9,7 @@ object HigherOrderFunctions extends FlatSpec with Matchers with org.scalaexercis /** 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. * - * 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. + * 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. */ def meetLambdaHigherOrderFunctions(res0: Int, res1: Int, res2: Int, res3: Int, res4: Int, res5: Int) { def lambda = { x: Int ⇒ x + 1 } @@ -68,7 +68,7 @@ object HigherOrderFunctions extends FlatSpec with Matchers with org.scalaexercis result2 should be(res1) } - /** We can take that closure and throw into a method and it will still hold the environment + /** We can take that closure and throw it into a method and it will still hold the environment */ def holdEnvironmentHigherOrderFunctions(res0: Int, res1: Int) { def summation(x: Int, y: Int ⇒ Int) = y(x) @@ -113,7 +113,7 @@ object HigherOrderFunctions extends FlatSpec with Matchers with org.scalaexercis fiveAdder(5) should be(res2) } - /** `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. + /** `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. */ def isInstanceOfMethodHigherOrderFunctions(res0: Boolean) { def addWithSyntaxSugar(x: Int) = (y: Int) ⇒ x + y @@ -121,7 +121,7 @@ object HigherOrderFunctions extends FlatSpec with Matchers with org.scalaexercis addWithSyntaxSugar(1).isInstanceOf[Function1[_, _]] should be(res0) } - /** Function taking another function as parameter. Helps in composing functions. + /** Function taking another function as a parameter. Helps in composing functions. * * Hint: a map method applies the function to each element of a list */ diff --git a/src/main/scala/stdlib/Options.scala b/src/main/scala/stdlib/Options.scala index ba7268e9..eaf56509 100644 --- a/src/main/scala/stdlib/Options.scala +++ b/src/main/scala/stdlib/Options.scala @@ -74,7 +74,7 @@ object Options extends FlatSpec with Matchers with org.scalaexercises.definition /** An alternative for pattern matching is performing collection style operations. * This is possible because an option could be looked at as a collection with either one or zero elements. * - * One of these operations is `map`. this operation allows to map the inner value to a different type while preserving the option + * One of these operations is `map`. This operation allows us to map the inner value to a different type while preserving the option */ def mapOptions(res0: Option[Double], res1: Option[Double]) { val number: Option[Int] = Some(3) @@ -88,7 +88,7 @@ object Options extends FlatSpec with Matchers with org.scalaexercises.definition /** Note that the type of result1 is now Option[Double], thanks to the scala type inference. */ } - /** Another operation is `fold`. this operation will extract the value from the option, or provide a default if the value is `None` + /** Another operation is `fold`. This operation will extract the value from the option, or provide a default if the value is `None` */ def foldOptions(res0: Int, res1: Int) { val number: Option[Int] = Some(3)