Skip to content

Commit

Permalink
compiling against latest scalaz
Browse files Browse the repository at this point in the history
  • Loading branch information
tonymorris committed Aug 31, 2012
1 parent c2625d7 commit 5650883
Show file tree
Hide file tree
Showing 10 changed files with 22 additions and 22 deletions.
10 changes: 5 additions & 5 deletions src/main/scala/com/ephox/argonaut/Context.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}

Expand Down Expand Up @@ -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 + "}"
}
}

Expand Down
4 changes: 2 additions & 2 deletions src/main/scala/com/ephox/argonaut/Cursor.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
2 changes: 1 addition & 1 deletion src/main/scala/com/ephox/argonaut/CursorHistory.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down
6 changes: 3 additions & 3 deletions src/main/scala/com/ephox/argonaut/CursorOp.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions src/main/scala/com/ephox/argonaut/CursorOpElement.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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 => "|<-"
Expand All @@ -94,7 +94,7 @@ trait CursorOpElements {
case CursorOpDeleteGoField(f) => "!--(" + f + ")"
case CursorOpDeleteLefts => "!<"
case CursorOpDeleteRights => ">!"
}).toList
}

def equal(e1: CursorOpElement, e2: CursorOpElement) =
e1 == e2
Expand Down
4 changes: 2 additions & 2 deletions src/main/scala/com/ephox/argonaut/EncodeJson.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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]] =
Expand Down
2 changes: 1 addition & 1 deletion src/main/scala/com/ephox/argonaut/Json.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
}
2 changes: 1 addition & 1 deletion src/main/scala/com/ephox/argonaut/JsonNumber.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/main/scala/com/ephox/argonaut/JsonObject.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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

}

Expand Down
6 changes: 3 additions & 3 deletions src/main/scala/com/ephox/argonaut/PrettyParams.scala
Original file line number Diff line number Diff line change
Expand Up @@ -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]())({
Expand Down Expand Up @@ -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) =
Expand Down

0 comments on commit 5650883

Please sign in to comment.