From 361a7a40d35e09d7f622fcafd28531172a139e0e Mon Sep 17 00:00:00 2001 From: Paul Phillips Date: Tue, 22 Dec 2009 20:11:29 +0000 Subject: Took full advantage of the new =>? alias for th... Took full advantage of the new =>? alias for the superverbosely named PartialFunction by renaming every usage of the latter except when in comments. --- src/scalap/scala/tools/scalap/scalax/rules/Rule.scala | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/scalap') diff --git a/src/scalap/scala/tools/scalap/scalax/rules/Rule.scala b/src/scalap/scala/tools/scalap/scalax/rules/Rule.scala index 1500b81050..f65c688aa7 100644 --- a/src/scalap/scala/tools/scalap/scalax/rules/Rule.scala +++ b/src/scalap/scala/tools/scalap/scalax/rules/Rule.scala @@ -56,9 +56,9 @@ trait Rule[-In, +Out, +A, +X] extends (In => Result[Out, A, X]) { def ^^[B](fa2b : A => B) = map(fa2b) - def ^^?[B](pf : PartialFunction[A, B]) = filter (pf.isDefinedAt(_)) ^^ pf + def ^^?[B](pf : A =>? B) = filter (pf.isDefinedAt(_)) ^^ pf - def ??(pf : PartialFunction[A, Any]) = filter (pf.isDefinedAt(_)) + def ??(pf : A =>? Any) = filter (pf.isDefinedAt(_)) def -^[B](b : B) = map { any => b } @@ -73,7 +73,7 @@ trait Rule[-In, +Out, +A, +X] extends (In => Result[Out, A, X]) { def >->[Out2, B, X2 >: X](fa2resultb : A => Result[Out2, B, X2]) = flatMap { a => any => fa2resultb(a) } - def >>?[Out2, B, X2 >: X](pf : PartialFunction[A, Rule[Out, Out2, B, X2]]) = filter(pf isDefinedAt _) flatMap pf + def >>?[Out2, B, X2 >: X](pf : A =>? Rule[Out, Out2, B, X2]) = filter(pf isDefinedAt _) flatMap pf def >>&[B, X2 >: X](fa2ruleb : A => Out => Result[Any, B, X2]) = flatMap { a => out => fa2ruleb(a)(out) mapOut { any => out } } -- cgit v1.2.3