Commits

Maxime Buquet committed ab4aad2

Zip type changed, matches needs only

Comments (0)

Files changed (1)

     type key = F.t
 
     type t = 
-        | Empty
         | Zip of key list * key * key list
 
-    let empty = Empty
-    let is_empty z = z = Empty
+    let empty = Zip ([], F.zero, [])
 
-    let pop = function
-        | Empty -> raise OutofBounds
-        | Zip (_, v, _) -> v
+    let pop = function Zip (_, v, _) -> v
 
     let right = function
-        | Empty -> Zip ([], F.zero, [])
         | Zip (rl, v, []) -> Zip (v :: rl, F.zero, [])
         | Zip (rl, v, n :: ll) -> Zip (v :: rl, n, ll)
 
     let left = function
-        | Empty -> Zip ([], F.zero, [])
         | Zip ([], v, ll) -> Zip ([], F.zero, v :: ll)
         | Zip (n :: rl, v, ll) -> Zip (rl, n, v :: ll)
 
     let push x = function
-        | Empty -> Zip ([], x, [])
         | Zip (rl, _, ll) -> Zip (rl, x, ll)
 
 end