anchor.diff:                  (key, (if zeroBit (key, m) then t0 else t1))
   
       //
  -    static member Count (map : PatriciaMap<'T>) : int =
  +    static member CountOriginal (map : PatriciaMap<'T>) : int =
           // OPTIMIZE : We can 'strictify' this by adding an accumulator argument, so we'll
           // only need to use continuations for one side of the tree (left or right child).
           // We may also be able to eliminate continuations altogether by using an explicit
  
positive.code: 
      //
      member __.ToArray () : (int * 'T)[] =
          trie.ToArray ()
  
      //
      member internal __.ToKvpArray () : KeyValuePair<int, 'T>[] =
  
negative.code:             // Add the initial tree to the stack.
              stack.Push t
  
              // Loop until we've processed the entire tree.
              while stack.Count <> 0 do
                  match stack.Pop () with
                  | Empty -> ()
                  | Lf (k, x) ->
                      action.Invoke (int k, x)
                      
                  (* OPTIMIZATION :   When one or both children of this node are leaves, we handle
                                      them directly since it's a little faster. *)
                  | Br (_, _, Lf (k, x), Lf (j, y)) ->
                      action.Invoke (int k, x)
                      action.Invoke (int j, y)
                      
                  | Br (_, _, Lf (k, x), right) ->
                      // Only handle the case where the left child is a leaf -- otherwise
                      // the traversal order would be altered.
                      action.Invoke (int k, x)
                      stack.Push right
  
                  | Br (_, _, left, right) ->
                      // Push both children onto the stack and recurse to process them.
                      // NOTE : They're pushed in the opposite order we want to visit them!
                      stack.Push right
                      stack.Push left
  
      //
      member this.IterateBack (action : int -> 'T -> unit) : unit =
          match this with
          | Empty -> ()
          | Lf (k, x) ->
              action (int k) x
          | Br (_,_,_,_) as t ->
              let action = FSharpFunc<_,_,_>.Adapt action
  
              // TODO : Run some experiments to determine if this is a good initial capacity,
              // or if there is a more suitable value.
              let stack = System.Collections.Generic.Stack (64)
  
              // Add the initial tree to the stack.
              stack.Push t
  
              // Loop until we've processed the entire tree.
              while stack.Count <> 0 do
                  match stack.Pop () with
                  | Empty -> ()
                  | Lf (k, x) ->
                      action.Invoke (int k, x)
                      
                  (* OPTIMIZATION :   When one or both children of this node are leaves, we handle
                                      them directly since it's a little faster. *)
                  | Br (_, _, Lf (k, x), Lf (j, y)) ->
                      action.Invoke (int j, y)
                      action.Invoke (int k, x)
                      
                  | Br (_, _, left, Lf (k, x)) ->
                      // Only handle the case where the right child is a leaf -- otherwise
                      // the traversal order would be altered.
                      action.Invoke (int k, x)
                      stack.Push left
  
                  | Br (_, _, left, right) ->
                      // Push both children onto the stack and recurse to process them.
                      // NOTE : They're pushed in the opposite order we want to visit them!
                      stack.Push left
                      stack.Push right
  
      //
      member this.Fold (folder : 'State -> int -> 'T -> 'State, state : 'State) : 'State =
          match this with
          | Empty ->
              state
          | Lf (k, x) ->
              folder state (int k) x
          | Br (_,_,_,_) as t ->
              let folder = FSharpFunc<_,_,_,_>.Adapt folder
  
              // TODO : Run some experiments to determine if this is a good initial capacity,
              // or if there is a more suitable value.
              let stack = System.Collections.Generic.Stack (64)
  
              // Add the initial tree to the stack.
              stack.Push t
  
              /// Loop until we've processed the entire tree.
              let mutable state = state
              while stack.Count <> 0 do
                  match stack.Pop () with
                  | Empty -> ()
                  | Lf (k, x) ->
                      state <- folder.Invoke (state, int k, x)
                      
                  (* OPTIMIZATION :   When one or both children of this node are leaves, we handle
                                      them directly since it's a little faster. *)
                  | Br (_, _, Lf (k, x), Lf (j, y)) ->
                      state <- folder.Invoke (state, int k, x)
                      state <- folder.Invoke (state, int j, y)
                      
                  | Br (_, _, Lf (k, x), right) ->
                      // Only handle the case where the left child is a leaf -- otherwise
                      // the traversal order would be altered.
                      state <- folder.Invoke (state, int k, x)
                      stack.Push right
  
                  | Br (_, _, left, right) ->
                      // Push both children onto the stack and recurse to process them.
                      // NOTE : They're pushed in the opposite order we want to visit them!
                      stack.Push right
                      stack.Push left
  
              // Return the final state value.
              state
  
      //
      member this.FoldBack (folder : int -> 'T -> 'State -> 'State, state : 'State) : 'State =
          match this with
          | Empty ->
              state
          | Lf (k, x) ->
              folder (int k) x state
          | Br (_,_,_,_) as t ->
              let folder = FSharpFunc<_,_,_,_>.Adapt folder
  
              // TODO : Run some experiments to determine if this is a good initial capacity,
              // or if there is a more suitable value.
              let stack = System.Collections.Generic.Stack (64)
  
              // Add the initial tree to the stack.
              stack.Push t
  
              /// Loop until we've processed the entire tree.
              let mutable state = state
              while stack.Count <> 0 do
                  match stack.Pop () with
                  | Empty -> ()
                  | Lf (k, x) ->
                      state <- folder.Invoke (int k, x, state)
                      
                  (* OPTIMIZATION :   When one or both children of this node are leaves, we handle
                                      them directly since it's a little faster. *)
                  | Br (_, _, Lf (k, x), Lf (j, y)) ->
                      state <- folder.Invoke (int j, y, state)
                      state <- folder.Invoke (int k, x, state)
                      
                  | Br (_, _, left, Lf (k, x)) ->
                      // Only handle the case where the right child is a leaf -- otherwise
                      // the traversal order would be altered.
                      state <- folder.Invoke (int k, x, state)
                      stack.Push left
  
                  | Br (_, _, left, right) ->
                      // Push both children onto the stack and recurse to process them.
                      // NOTE : They're pushed in the opposite order we want to visit them!
                      stack.Push left
                      stack.Push right
  
              // Return the final state value.
              state
  
  
  //
  