Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

changed the run comment to "start the REPL"

  • Loading branch information...
commit 04c2b18d0300bf13f2c9e7a5d21d95c8b2623748 1 parent 0a97ae7
Lutz Hankewitz authored
2  chap04/extra/QuickSort.scala
View
@@ -1,4 +1,4 @@
-// Start scala and run via> :load QuickSort.scala
+// Start the scala REPL and run via> :load QuickSort.scala
def sort(xs: List[Int]): List[Int] = xs match {
case Nil => xs
5 chap04/extra/test/Coerce.scala
View
@@ -1,9 +1,11 @@
-// Start scala and run via> :load Coerce.scala
+// Start the scala REPL and run via> :load Coerce.scala
+// First order coercible
trait FOCoercible[-A, +B] {
def apply(a: A): B
}
+// First order bi-directional coercible
trait FOBicoercible[A, B] extends FOCoercible[A, B] {
def unapply(b: B): A
}
@@ -20,6 +22,7 @@ implicit def foidentityCoercion[A]: FOBicoercible[A, A] = new FOBicoercible[A, A
}
+// Higher order
trait HOCoercible[-AA[_], +BB[_]] {
def apply[A, B](a: AA[A])(implicit fo: FOCoercible[A, B]): BB[B]
}
2  chap04/extra/test/HigherKind.scala
View
@@ -1,4 +1,4 @@
-// Start scala and run via> :load HigherKind.scala
+// Start the scala REPL and run via> :load HigherKind.scala
//List("1", "2", "3").coerce[Set[Int]]
2  chap04/extra/test/HigherKind1.scala
View
@@ -1,4 +1,4 @@
-// Start scala and run via> :load HigherKind1.scala
+// Start the scala REPL and run via> :load HigherKind1.scala
trait TypeConverter[-A, +B] {
def apply(a: A): B
Please sign in to comment.
Something went wrong with that request. Please try again.