diff options
-rw-r--r-- | src/scalap/scala/tools/scalap/scalax/rules/Memoisable.scala | 2 | ||||
-rw-r--r-- | src/scalap/scala/tools/scalap/scalax/rules/Result.scala | 10 |
2 files changed, 6 insertions, 6 deletions
diff --git a/src/scalap/scala/tools/scalap/scalax/rules/Memoisable.scala b/src/scalap/scala/tools/scalap/scalax/rules/Memoisable.scala index 1324ea695a..827c2dfff7 100644 --- a/src/scalap/scala/tools/scalap/scalax/rules/Memoisable.scala +++ b/src/scalap/scala/tools/scalap/scalax/rules/Memoisable.scala @@ -44,7 +44,7 @@ trait DefaultMemoisable extends Memoisable { map.getOrElseUpdate(key, compute(key, a)).asInstanceOf[A] } - protected def compute[A](key : AnyRef, a : => A) = a match { + protected def compute[A](key : AnyRef, a : => A): Any = a match { case success : Success[_, _] => onSuccess(key, success); success case other => if(DefaultMemoisable.debug) println(key + " -> " + other) diff --git a/src/scalap/scala/tools/scalap/scalax/rules/Result.scala b/src/scalap/scala/tools/scalap/scalax/rules/Result.scala index 6befbb83c8..17ad4bd053 100644 --- a/src/scalap/scala/tools/scalap/scalax/rules/Result.scala +++ b/src/scalap/scala/tools/scalap/scalax/rules/Result.scala @@ -42,11 +42,11 @@ case class Success[+Out, +A](out : Out, value : A) extends Result[Out, A, Nothin def toOption = Some(value) - def map[B](f : A => B) = Success(out, f(value)) - def mapOut[Out2](f : Out => Out2) = Success(f(out), value) - def map[Out2, B](f : (Out, A) => (Out2, B)) = f(out, value) match { case (out2, b) => Success(out2, b) } - def flatMap[Out2, B](f : (Out, A) => Result[Out2, B, Nothing]) = f(out, value) - def orElse[Out2 >: Out, B >: A](other : => Result[Out2, B, Nothing]) = this + def map[B](f : A => B) : Result[Out, B, Nothing] = Success(out, f(value)) + def mapOut[Out2](f : Out => Out2) : Result[Out2, A, Nothing] = Success(f(out), value) + def map[Out2, B](f : (Out, A) => (Out2, B)) : Success[Out2, B] = f(out, value) match { case (out2, b) => Success(out2, b) } + def flatMap[Out2, B](f : (Out, A) => Result[Out2, B, Nothing]) : Result[Out2, B, Nothing]= f(out, value) + def orElse[Out2 >: Out, B >: A](other : => Result[Out2, B, Nothing]) : Result[Out2, B, Nothing] = this } sealed abstract class NoSuccess[+X] extends Result[Nothing, Nothing, X] { |