anchor.diff:                      else
                           this :> INode
   
  -
  -type PersistentHashMap<[<EqualityConditionalOn>]'T, 'S when 'T : equality and 'S : equality> (count,root:INode,hasNull, nullValue:'S) =
  +            member this.without(thread1, shift, hashKey, key, removedLeaf) =
  +                let bit = NodeHelpers.bitpos(hashKey, shift)
  +                if (bitmap &&& bit) = 0 then this :> INode else
  +                let idx = NodeHelpers.index(bitmap,bit)
  +
  +                let keyOrNull = array.[2*idx]
  +                let valOrNode = array.[2*idx+1]
  +                if keyOrNull = null then
  +                    let n = (valOrNode :?> INode).without(thread1, shift + 5, hashKey, key, removedLeaf)
  +                    if n = (valOrNode :?> INode) then this :> INode else
  +                    if n <> Unchecked.defaultof<INode> then this.editAndSet(thread1, 2*idx+1, n) :> INode else
  +                    if bitmap = bit then Unchecked.defaultof<INode> else
  +                    this.editAndRemovePair(thread1, bit, idx) :> INode
  +                else
  +                    if key = keyOrNull then
  +                        removedLeaf.Value <- removedLeaf :> obj
  +                        // TODO: collapse
  +                        this.editAndRemovePair(thread1, bit, idx) :> INode
  +                    else
  +                        this :> INode
  +
  +type TransiententHashMap<[<EqualityConditionalOn>]'T, 'S when 'T : equality and 'S : equality> (thread,count,root:INode,hasNull,nullValue:'S) =
  +    let mutable hasNull = hasNull
  +    let mutable nullValue = nullValue
  +    let mutable count = count
  +    let mutable root = root
  +    let leafFlag = Box(null)
       
  -    static member Empty() : PersistentHashMap<'T, 'S> = PersistentHashMap(0, Unchecked.defaultof<INode>, false, Unchecked.defaultof<'S>)
  +    static member Empty() : TransiententHashMap<'T, 'S> = TransiententHashMap(ref Thread.CurrentThread,0, Unchecked.defaultof<INode>, false, Unchecked.defaultof<'S>)
       member this.Length : int = count
  +
  +    member internal this.EnsureEditable() =
  +        if !thread = Thread.CurrentThread then () else
  +        if !thread <> null then 
  +            failwith "Transient used by non-owner thread"
  +        failwith "Transient used after persistent! call"
   
       member this.ContainsKey (key:'T) =
           if key = Unchecked.defaultof<'T> then hasNull else
  
positive.code:         System.Array.Copy(array, 2*(i+1), newArray, 2*i, newArray.Length - 2*i)
          newArray
  
      static member createNode( shift, key1, val1, key2hash, key2, val2) =
          let key1hash = hash(key1)
  
          if key1hash = key2hash then HashCollisionNode(ref null, key1hash, 2, [|key1; val1; key2; val2|]) :> INode else 
          
          let addedLeaf = Box(null)
          let edit = ref null
          (BitmapIndexedNode() :> INode)
              .assoc(shift, key1hash, key1, val1, addedLeaf) // edit
              .assoc(shift, key2hash, key2, val2, addedLeaf) // edit
  
  and HashCollisionNode(thread,hashCollisionKey,count,array:obj[]) =
      let findIndex key =
          let i = ref 0
          while (!i < 2*count) && (key <> array.[!i]) do
              i := !i + 2
          if !i < 2*count then !i else -1
          
      with
      
          interface INode with
              member this.assoc(shift, hashKey, key, value, addedLeaf) : INode = 
                  if hashKey = hashCollisionKey then
                      let idx = findIndex(key)
                      if idx <> -1 then
                          if array.[idx + 1] = value then this :> INode else
                          HashCollisionNode(ref null, hashKey, count, NodeHelpers.cloneAndSet(array, idx + 1, value)) :> INode
  
negative.code:                 else
                      let n = node.assoc(shift + 5, hashKey, key, value, addedLeaf)
                      if n = node then this :> INode else
                      ArrayNode(ref null, count, NodeHelpers.cloneAndSet(array, idx, n)) :> INode
  
              member this.assoc(thread1, shift, hashKey, key, value, addedLeaf) : INode = 
                  let idx = NodeHelpers.mask(hashKey, shift)
                  let node = array.[idx]
                  if node = Unchecked.defaultof<INode> then
                      let editable = this.editAndSet(thread1, idx, (BitmapIndexedNode() :> INode).assoc(thread1, shift + 5, hashKey, key, value, addedLeaf))
                      editable.count <- editable.count + 1
                      editable :> INode                      
                  else
                      let n = node.assoc(thread1, shift + 5, hashKey, key, value, addedLeaf);
                      if n = node then this :> INode else this.editAndSet(thread1, idx, n) :> INode
  
              member this.find(shift, hash, key) =
                  let idx = NodeHelpers.mask(hash, shift)
  