From 5650883f758cf0bca61b19cc55567629915bcc03 Mon Sep 17 00:00:00 2001 From: Tony Morris Date: Fri, 31 Aug 2012 13:39:35 +1000 Subject: [PATCH] compiling against latest scalaz --- src/main/scala/com/ephox/argonaut/Context.scala | 10 +++++----- src/main/scala/com/ephox/argonaut/Cursor.scala | 4 ++-- src/main/scala/com/ephox/argonaut/CursorHistory.scala | 2 +- src/main/scala/com/ephox/argonaut/CursorOp.scala | 6 +++--- .../scala/com/ephox/argonaut/CursorOpElement.scala | 6 +++--- src/main/scala/com/ephox/argonaut/EncodeJson.scala | 4 ++-- src/main/scala/com/ephox/argonaut/Json.scala | 2 +- src/main/scala/com/ephox/argonaut/JsonNumber.scala | 2 +- src/main/scala/com/ephox/argonaut/JsonObject.scala | 2 +- src/main/scala/com/ephox/argonaut/PrettyParams.scala | 6 +++--- 10 files changed, 22 insertions(+), 22 deletions(-) diff --git a/src/main/scala/com/ephox/argonaut/Context.scala b/src/main/scala/com/ephox/argonaut/Context.scala index a55d5669..fbb60563 100644 --- a/src/main/scala/com/ephox/argonaut/Context.scala +++ b/src/main/scala/com/ephox/argonaut/Context.scala @@ -28,8 +28,8 @@ trait Contexts { new Equal[Context] with Show[Context] { def equal(c1: Context, c2: Context) = Equal.equalBy((_: Context).toList).equal(c1, c2) - def show(c: Context) = - c.toList.map(_.show).intersperse(List('.')).join + override def show(c: Context) = + c.toList.map(_.shows).intersperse(".").mkString } } @@ -96,10 +96,10 @@ trait ContextElements { } } - def show(c: ContextElement) = + override def show(c: ContextElement) = c match { - case ArrayContext(n, j) => ("[" + n + "]").toList - case ObjectContext(f, j) => ("{" + f + "}").toList + case ArrayContext(n, j) => "[" + n + "]" + case ObjectContext(f, j) => "{" + f + "}" } } diff --git a/src/main/scala/com/ephox/argonaut/Cursor.scala b/src/main/scala/com/ephox/argonaut/Cursor.scala index fe61fc34..07c96a7b 100644 --- a/src/main/scala/com/ephox/argonaut/Cursor.scala +++ b/src/main/scala/com/ephox/argonaut/Cursor.scala @@ -558,7 +558,7 @@ trait Cursors { } } - def show(c: Cursor) = - List(c.context.show, " ==> ".toList, c.focus.show).join + override def show(c: Cursor) = + c.context.show + " ==> " + c.focus.show } } diff --git a/src/main/scala/com/ephox/argonaut/CursorHistory.scala b/src/main/scala/com/ephox/argonaut/CursorHistory.scala index c1ea97e9..a9330dc6 100644 --- a/src/main/scala/com/ephox/argonaut/CursorHistory.scala +++ b/src/main/scala/com/ephox/argonaut/CursorHistory.scala @@ -59,7 +59,7 @@ trait CursorHistorys { implicit val CursorHistoryInstances: Show[CursorHistory] with Equal[CursorHistory] with Monoid[CursorHistory] = new Show[CursorHistory] with Equal[CursorHistory] with Monoid[CursorHistory] { - def show(h: CursorHistory) = Show[List[CursorOp]].show(h.toList) + override def show(h: CursorHistory) = Show[List[CursorOp]].show(h.toList) def equal(h1: CursorHistory, h2: CursorHistory) = h1.toList === h2.toList def zero = CursorHistory.build(List()) diff --git a/src/main/scala/com/ephox/argonaut/CursorOp.scala b/src/main/scala/com/ephox/argonaut/CursorOp.scala index c0634a7e..0b92cca6 100644 --- a/src/main/scala/com/ephox/argonaut/CursorOp.scala +++ b/src/main/scala/com/ephox/argonaut/CursorOp.scala @@ -39,9 +39,9 @@ trait CursorOps { implicit val CursorOpInstances: Show[CursorOp] with Equal[CursorOp] = new Show[CursorOp] with Equal[CursorOp] { - def show(x: CursorOp) = x match { - case Reattempt => List('.', '?', '.') - case El(o, s) => if(s) o.show else '*' :: '.' :: o.show + override def show(x: CursorOp) = x match { + case Reattempt => ".?." + case El(o, s) => if(s) o.show else '*' -: '.' -: o.show } def equal(a1: CursorOp, a2: CursorOp) = a1 == a2 diff --git a/src/main/scala/com/ephox/argonaut/CursorOpElement.scala b/src/main/scala/com/ephox/argonaut/CursorOpElement.scala index aded6500..a8a4be97 100644 --- a/src/main/scala/com/ephox/argonaut/CursorOpElement.scala +++ b/src/main/scala/com/ephox/argonaut/CursorOpElement.scala @@ -70,8 +70,8 @@ object CursorOpElement extends CursorOpElements trait CursorOpElements { implicit val CursorOpElementInstances: Show[CursorOpElement] with Equal[CursorOpElement] = new Show[CursorOpElement] with Equal[CursorOpElement] { - def show(e: CursorOpElement) = - (e match { + override def show(e: CursorOpElement) = + e match { case CursorOpLeft => "<-" case CursorOpRight => "->" case CursorOpFirst => "|<-" @@ -94,7 +94,7 @@ trait CursorOpElements { case CursorOpDeleteGoField(f) => "!--(" + f + ")" case CursorOpDeleteLefts => "!<" case CursorOpDeleteRights => ">!" - }).toList + } def equal(e1: CursorOpElement, e2: CursorOpElement) = e1 == e2 diff --git a/src/main/scala/com/ephox/argonaut/EncodeJson.scala b/src/main/scala/com/ephox/argonaut/EncodeJson.scala index f8a19d73..465a66b7 100644 --- a/src/main/scala/com/ephox/argonaut/EncodeJson.scala +++ b/src/main/scala/com/ephox/argonaut/EncodeJson.scala @@ -108,8 +108,8 @@ trait EncodeJsons { implicit def ValidationEncodeJson[E, A](implicit ea: EncodeJson[E], eb: EncodeJson[A]): EncodeJson[Validation[E, A]] = EncodeJson(_ fold ( - failure = e => jSingleObject("Failure", ea(e)) - , success = a => jSingleObject("Success", eb(a)) + e => jSingleObject("Failure", ea(e)) + , a => jSingleObject("Success", eb(a)) ), "[E, A]Validation[E, A]") implicit def MapEncodeJson[V](implicit e: EncodeJson[V]): EncodeJson[Map[String, V]] = diff --git a/src/main/scala/com/ephox/argonaut/Json.scala b/src/main/scala/com/ephox/argonaut/Json.scala index 0c781be0..abad7bab 100644 --- a/src/main/scala/com/ephox/argonaut/Json.scala +++ b/src/main/scala/com/ephox/argonaut/Json.scala @@ -625,6 +625,6 @@ trait Jsons { case JObject(o) => a2.obj exists (_ === o) } - def show(a: Json) = Show.showFromToString show a + override def show(a: Json) = Show.showFromToString show a } } diff --git a/src/main/scala/com/ephox/argonaut/JsonNumber.scala b/src/main/scala/com/ephox/argonaut/JsonNumber.scala index 0fdd49b6..9d52570a 100644 --- a/src/main/scala/com/ephox/argonaut/JsonNumber.scala +++ b/src/main/scala/com/ephox/argonaut/JsonNumber.scala @@ -76,7 +76,7 @@ trait JsonNumbers { def zero = JsonNumber(Monoid[Double].zero) def append(x: JsonNumber, y: => JsonNumber) = JsonNumber(Monoid[Double].append(x.toDouble, y.toDouble)) - def show(x: JsonNumber) = + override def show(x: JsonNumber) = Show[Double].show(x.toDouble) def order(x: JsonNumber, y: JsonNumber) = x compare y diff --git a/src/main/scala/com/ephox/argonaut/JsonObject.scala b/src/main/scala/com/ephox/argonaut/JsonObject.scala index 7433cc07..c80ecbf4 100644 --- a/src/main/scala/com/ephox/argonaut/JsonObject.scala +++ b/src/main/scala/com/ephox/argonaut/JsonObject.scala @@ -146,7 +146,7 @@ trait JsonObjects { new Equal[JsonObject] with Show[JsonObject] { def equal(j1: JsonObject, j2: JsonObject) = j1.toMap == j2.toMap - def show(a: JsonObject) = Show.showFromToString show a + override def show(a: JsonObject) = Show.showFromToString show a } diff --git a/src/main/scala/com/ephox/argonaut/PrettyParams.scala b/src/main/scala/com/ephox/argonaut/PrettyParams.scala index ad5ab08c..85472327 100644 --- a/src/main/scala/com/ephox/argonaut/PrettyParams.scala +++ b/src/main/scala/com/ephox/argonaut/PrettyParams.scala @@ -102,7 +102,7 @@ sealed trait PrettyParams { k.fold( Vector('n', 'u', 'l', 'l') , if(_) Vector('t', 'r', 'u', 'e') else Vector('f', 'a', 'l', 's', 'e') - , n => Vector(Show[JsonNumber].show(n): _*) + , n => Vector(Show[JsonNumber].show(n).toList: _*) , s => '"' +: Vector(s flatMap escape: _*) :+ '"' , e => lbracket ++ e.reverse.foldLeft(false, Vector[Char]())({ @@ -410,8 +410,8 @@ trait JsonWhitespacess { new Equal[JsonWhitespaces] with Show[JsonWhitespaces] with Monoid[JsonWhitespaces] { def equal(s1: JsonWhitespaces, s2: JsonWhitespaces) = s1.toList == s2.toList - def show(s: JsonWhitespaces) = - s.toList map (_.toChar) + override def show(s: JsonWhitespaces) = + s.toList map (_.toChar) mkString def zero = JsonWhitespaces.build(Vector()) def append(s1: JsonWhitespaces, s2: => JsonWhitespaces) =