Commits

Jim Apple  committed 090b0ea

Simplify cases where no explicit decomposition of result is necessary

  • Participants
  • Parent commits 4079d33

Comments (0)

Files changed (1)

                          Two r' p pk q | r' == r -> Three r a ak p pk q
                          b -> Two r a ak b
                    Three r a ak b bk c ->
-                       case join c mid y of
-                         Two r' p pk q | r' == r -> Two (r+1) (two a ak b) bk (two p pk q)
-                         c -> Three r a ak b bk c
+                       let c' = join c mid y
+                       in if rank c' == r
+                          then Two (r+1) (two a ak b) bk c'
+                          else Three r a ak b bk c'
              | otherwise = -- not (isLeaf x) && not (isLeaf y) && rank x == rank y
                  case x of
                    Two r a ak b ->