Skip to content

Commit 4934d1d

Browse files
committed
Merging tweaks to examples.
1 parent 4d237ce commit 4934d1d

File tree

4 files changed

+12
-5
lines changed

4 files changed

+12
-5
lines changed

build.sbt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ libraryDependencies ++= Seq(
2424
)
2525

2626
scalacOptions ++= Seq(
27-
"-encoding", "UTF-8", "-optimise",
27+
"-encoding", "UTF-8", "-optimise",
2828
"-deprecation", "-unchecked", "-feature", "-Xlint", "-Ywarn-infer-any")
2929

3030
javacOptions ++= Seq(

misc/parthenon-payroll.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Input for the Parthenon Payroll example.h
2+
# See the "Application Design" Chapter and
3+
# src/main/scala/progscala2/appdesign/parthenon/payroll-use-cases.scala
4+
# Name, annual salary, fed tax, state tax, insurance premiums, retirement
5+
Joe CEO, 200000.0, 20.0, 5.0, 200.0, 5.0
6+
Jane CFO, 180000.0, 20.0, 5.0, 250.0, 7.0
7+
Phil Coder, 120000.0, 15.0, 5.0, 150.0, 10.0

src/main/scala/progscala2/concurrency/futures/future-callbacks.sc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ case class ThatsOdd(i: Int) extends RuntimeException( // <1>
99
import scala.util.{Try, Success, Failure} // <2>
1010

1111
val doComplete: PartialFunction[Try[String],Unit] = { // <3>
12-
case s @ Success(string) => println(s) // <4>
13-
case f @ Failure(ex) => println(f)
12+
case s @ Success(_) => println(s) // <4>
13+
case f @ Failure(_) => println(f)
1414
}
1515

1616
val futures = (0 to 9) map { // <5>

src/main/scala/progscala2/metaprogramming/match-types.sc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22

33
import scala.reflect.ClassTag
44

5-
def doClassTagMatch[T : ClassTag](seq: Seq[T]): String = seq match { // <1>
5+
def useClassTag[T : ClassTag](seq: Seq[T]): String = seq match { // <1>
66
case Nil => "Nothing"
77
case head +: _ => implicitly(seq.head).getClass.toString // <2>
88
}
99

1010
def check(seq: Seq[_]): String = // <3>
11-
s"Seq: ${doClassTagMatch(seq)}"
11+
s"Seq: ${useClassTag(seq)}"
1212

1313
Seq(Seq(5.5,5.6,5.7), Seq("a", "b"), // <4>
1414
Seq(1, "two", 3.14), Nil) foreach {

0 commit comments

Comments
 (0)