From 7a2dfc71cf28d1dde2155a1663ad9a39b2e397c8 Mon Sep 17 00:00:00 2001
From: Manos Koukoutos <emmanouil.koukoutos@epfl.ch>
Date: Tue, 26 Apr 2016 14:39:46 +0200
Subject: [PATCH] Improve this benchmark

---
 testcases/synthesis/current/RunLength/RunLength.scala | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/testcases/synthesis/current/RunLength/RunLength.scala b/testcases/synthesis/current/RunLength/RunLength.scala
index 8813b97f7..1969220be 100644
--- a/testcases/synthesis/current/RunLength/RunLength.scala
+++ b/testcases/synthesis/current/RunLength/RunLength.scala
@@ -18,12 +18,10 @@ object RunLength {
   }
 
   def legal[A](l: List[(BigInt, A)]): Boolean = l match {
-    case Cons((i, x), tl) =>
-      i > 0 && (tl match {
-        case Cons((_, y), _) => x != y
-        case _ => true
-      }) && legal(tl)
-    case _ => true
+    case Nil() => true
+    case Cons((i, _), Nil()) => i > 0
+    case Cons((i, x), tl@Cons((_, y), _)) =>
+      i > 0 && x != y && legal(tl)
   }
 
   def encode[A](l: List[A]): List[(BigInt, A)] = {
-- 
GitLab