anchor.diff:      member __.FoldBack (folder : int -> 'T -> 'State -> 'State, state : 'State) : 'State =
           trie.FoldBack (folder, state)
   
  +    //
  +    member __.TryFindKey (predicate : int -> 'T -> bool) : int option =
  +        trie.TryFindKey predicate
  +
  +    //
  +    member this.FindKey (predicate : int -> 'T -> bool) : int =
  +        match this.TryFindKey predicate with
  +        | Some key ->
  +            key
  +        | None ->
  +            raise <| System.Collections.Generic.KeyNotFoundException ()
  +
  +    //
  +    member this.Exists (predicate : int -> 'T -> bool) : bool =
  +        this.TryFindKey predicate
  +        |> Option.isSome
  +
  +    //
  +    member this.Forall (predicate : int -> 'T -> bool) : bool =
  +        this.TryFindKey (fun k v ->
  +            not <| predicate k v)
  +        |> Option.isNone
  +
  +    //
  +    member __.TryPick (picker : int -> 'T -> 'U option) : 'U option =
  +        trie.TryPick picker
  +
  +    //
  +    member this.Pick (picker : int -> 'T -> 'U option) : 'U =
  +        match this.TryPick picker with
  +        | Some value ->
  +            value
  +        | None ->
  +            raise <| System.Collections.Generic.KeyNotFoundException ()
  +
  +    //
  +    member __.ToSeq () =
  +        trie.ToSeq ()
  +
  +    (* OPTIMIZE : The methods below should be replaced with optimized implementations where possible. *)
  +
  +    //
  +    member this.Choose (chooser : int -> 'T -> 'U option) : IntMap<'U> =
  +        let chooser = FSharpFunc<_,_,_>.Adapt chooser
  +
  +        this.Fold ((fun chosenMap key value ->
  +            match chooser.Invoke (key, value) with
  +            | None ->
  +                chosenMap
  +            | Some newValue ->
  +                chosenMap.Add (key, newValue)), IntMap.Empty)
  +
  +    //
  +    member this.Filter (predicate : int -> 'T -> bool) : IntMap<'T> =
  +        let predicate = FSharpFunc<_,_,_>.Adapt predicate
  +
  +        this.Fold ((fun filteredMap key value ->
  +            if predicate.Invoke (key, value) then
  +                filteredMap
  +            else
  +                filteredMap.Remove key), this)
  +
  +    //
  +    // OPTIMIZE : We should be able to implement an optimized version
  +    // of Map which builds the mapped trie from the bottom-up; this works
  +    // because the mapped trie will have the same structure as the original,
  +    // just with different values in the leaves.
  +    member this.Map (mapping : int -> 'T -> 'U) : IntMap<'U> =
  +        let mapping = FSharpFunc<_,_,_>.Adapt mapping
  +
  +        this.Fold ((fun map key value ->
  +            map.Add (key, mapping.Invoke (key, value))), IntMap.Empty)
  +
  +    //
  +    member this.Partition (predicate : int -> 'T -> bool) : IntMap<'T> * IntMap<'T> =
  +        let predicate = FSharpFunc<_,_,_>.Adapt predicate
  +
  +        this.Fold ((fun (trueMap, falseMap) key value ->
  +            if predicate.Invoke (key, value) then
  +                trueMap.Add (key, value),
  +                falseMap
  +            else
  +                trueMap,
  +                falseMap.Add (key, value)), (IntMap.Empty, IntMap.Empty))
  +
  +    //
  +    member this.MapPartition (partitioner : int -> 'T -> Choice<'U, 'V>) : IntMap<'U> * IntMap<'V> =
  +        let partitioner = FSharpFunc<_,_,_>.Adapt partitioner
  +
  +        this.Fold ((fun (map1, map2) key value ->
  +            match partitioner.Invoke (key, value) with
  +            | Choice1Of2 value ->
  +                map1.Add (key, value),
  +                map2
  +            | Choice2Of2 value ->
  +                map1,
  +                map2.Add (key, value)), (IntMap.Empty, IntMap.Empty))
  +
  +    // TODO
  +    // union
   
   //
   and [<Sealed>]
  
positive.code: 
          map.FoldBack (folder, state)
  
  
      (* TEMP :   The implementations of the functions below should be moved into IntMap members,
                  and replaced with optimized implementations where possible. *)
  
      //
      let choose (chooser : int -> 'T -> 'U option) (map : IntMap<'T>) : IntMap<'U> =
          // Preconditions
          checkNonNull "map" map
  
          let chooser = FSharpFunc<_,_,_>.Adapt chooser
  
          (IntMap.Empty, map)
          ||> fold (fun chosenMap key value ->
              match chooser.Invoke (key, value) with
              | None ->
                  chosenMap
              | Some newValue ->
                  chosenMap.Add (key, newValue))
  
      //
      let filter (predicate : int -> 'T -> bool) (map : IntMap<'T>) : IntMap<'T> =
          // Preconditions
          checkNonNull "map" map
  
          let predicate = FSharpFunc<_,_,_>.Adapt predicate
  
          (map, map)
          ||> fold (fun filteredMap key value ->
              if predicate.Invoke (key, value) then
                  filteredMap
              else
                  filteredMap.Remove key)
  
      //
      let map (mapping : int -> 'T -> 'U) (map : IntMap<'T>) : IntMap<'U> =
          // Preconditions
          checkNonNull "map" map
  
          let mapping = FSharpFunc<_,_,_>.Adapt mapping
  
          (IntMap.Empty, map)
          ||> fold (fun map key value ->
              map.Add (key, mapping.Invoke (key, value)))
  
      //
      let partition (predicate : int -> 'T -> bool) (map : IntMap<'T>) : IntMap<'T> * IntMap<'T> =
          // Preconditions
          checkNonNull "map" map
  
          let predicate = FSharpFunc<_,_,_>.Adapt predicate
  
          ((IntMap.Empty, IntMap.Empty), map)
          ||> fold (fun (trueMap, falseMap) key value ->
              if predicate.Invoke (key, value) then
                  trueMap.Add (key, value),
                  falseMap
              else
                  trueMap,
                  falseMap.Add (key, value))
  
      //
      let mapPartition (partitioner : int -> 'T -> Choice<'U, 'V>) (map : IntMap<'T>) : IntMap<'U> * IntMap<'V> =
          // Preconditions
          checkNonNull "map" map
  
          let partitioner = FSharpFunc<_,_,_>.Adapt partitioner
  
          ((IntMap.Empty, IntMap.Empty), map)
          ||> fold (fun (map1, map2) key value ->
              match partitioner.Invoke (key, value) with
              | Choice1Of2 value ->
                  map1.Add (key, value),
                  map2
              | Choice2Of2 value ->
                  map1,
                  map2.Add (key, value))
  
  
  
      // TODO
      // exists
      // findKey
      // forall
      // pick
      // toSeq
      // tryFindKey
      // tryPick
      // union
  
  
  (* TODO : Can we just implement TagMap as a measure-annotated IntMap? *)
  
negative.code:     let inline lowestBit (x : int) : uint32 =
          uint32 (x &&& -x)
  
      // http://aggregate.org/MAGIC/#Most%20Significant%201%20Bit
      let inline private branchingBitFast (x : uint32) =
          let x = x ||| (x >>> 1)
          let x = x ||| (x >>> 2)
          let x = x ||| (x >>> 4)
          let x = x ||| (x >>> 8)
          let x = x ||| (x >>> 16)
          x &&& ~~~(x >>> 1)
  
      /// Finds the first bit at which p0 and p1 disagree.
      /// Returns a power-of-two value containing this (and only this) bit.
      let inline branchingBit (p0, p1) : uint32 =
          branchingBitFast (p0 ^^^ p1)
  
  
  open BitOps
  