anchor.diff:      let foldWithKey f z =
           let rec go z =
               function
  -            | Nil -> z
               | Tip(kx, x) -> f z kx x
               | Bin(_, _, l, r) -> go (go z l) r
  +            | Nil -> z
           fun t ->
               match t with
  -            | Bin(_, m, l, r) when m < 0 -> go (go z r) l  // put negative numbers before.
  -            | Bin(_, m, l, r) -> go (go z l) r
  +            | Bin(_, m, l, r) ->
  +                if m < 0 then go (go z r) l  // put negative numbers before.
  +                else go (go z l) r
               | _ -> go z t
       
       ///O(n). Return all elements of the map in the ascending order of their keys. Credit: Haskell.org
  
positive.code: 
      ///O(n+m). The expression (isSubmapOfBy f m1 m2) returns True if all keys in m1 are in m2, and when f returns True when applied to their respective values. Credit: Haskell.org
      let rec isSubmapOfBy predicate t1 t2 =
        match t1, t2 with
        | Bin(p1, m1, l1, r1), Bin(p2, m2, l2, r2) when shorter m1 m2 -> false
        | Bin(p1, m1, l1, r1), Bin(p2, m2, l2, r2) when shorter m2 m1 ->
            match' p1 p2 m2 &&
                (if zero p1 m2 then isSubmapOfBy predicate t1 l2
                    else isSubmapOfBy predicate t1 r2)
        | Bin(p1, m1, l1, r1), Bin(p2, m2, l2, r2) ->
            (p1 = p2) && isSubmapOfBy predicate l1 l2 && isSubmapOfBy predicate r1 r2
        | Bin _, _ -> false
        | Tip(k, x), t ->
            match tryFind k t with
            | Some y  -> predicate x y
            | None -> false
        | Nil, _ -> true
  
      ///O(n+m). Is this a submap? Defined as (isSubmapOf = isSubmapOfBy (==)). Credit: Haskell.org
      let isSubmapOf m1 m2 = isSubmapOfBy (=) m1 m2
  
negative.code:             if t1 == t2 then
                  Nil
              else
                  match t1 with
                  | Bin(p1, m1, l1, r1) ->
                      match t2 with
                      | Bin(p2, m2, l2, r2) ->
                          if shorter m1 m2 then merge1 p1 m1 t1 l1 r1 p2 m2 t2
                          elif shorter m2 m1 then merge2 p1 m1 t1 p2 m2 t2 l2 r2
                          elif p1 = p2 then bin p1 m1 (go l1 l2) (go r1 r2)
                          else maybe_join p1 (del t1) p2 (add t2)
                      | Tip (k2', _) ->
                          let rec merge t2 k2 t1 =
                              match t1 with
                              | Bin(p1, m1, l1, r1) ->
                                  if nomatch k2 p1 m1 then maybe_join p1 (del t1) k2 (add t2)
                                  elif zero k2 m1 then bin p1 m1 (merge t2 k2 l1) (del r1)
                                  else bin p1 m1 (del l1) (merge t2 k2 r1)
                              | Tip(k1, _) ->
                                  if k1 = k2 then ifChanged t1 t2
                                  else maybe_join k1 (del t1) k2 (add t2)
                              | _ -> add t2
                          merge t2 k2' t1
                      | _ -> del t1
                  | Tip(k1', _) ->
                      let rec merge t1 k1 t2 =
                          match t2 with
                          | Bin(p2, m2, l2, r2) ->
                              if nomatch k1 p2 m2 then maybe_join k1 (del t1) p2 (add t2)
                              elif zero k1 m2 then bin p2 m2 (merge t1 k1 l2) (add r2)
                              else bin p2 m2 (add l2) (merge t1 k1 r2)
                          | Tip(k2, _) ->
                              if k1 = k2 then ifChanged t1 t2
                              else maybe_join k1 (del t1) k2 (add t2)
                          | _ -> del t1
                      merge t1 k1' t2
                  | _ -> add t2
          go
  
      
  