anchor.diff:              Array.blit karr.Values_ 0 values 0 karr.Current_
               karr.Values_ <- values
   
  -    let compact karr =
  +    let private compact karr =
           
           // check underflow
           if underflowing karr then
  
positive.code: open Prime
  open System.Collections.Generic
  
  /// A garbage-collected keyed array.
  /// TODO: once this is well-tested, let's consider moving into Prime.
  type [<NoEquality; NoComparison>] KeyedArray<'k, 'v when 'k : comparison> =
      private
          { Keys_ : SortedDictionary<int, 'k>
            Indices_ : SortedDictionary<'k, int>
            mutable Values_ : struct (bool * 'k * 'v) array
            mutable Current_ : int
            mutable Removed_ : single // single to elide unecessary conversions
            mutable Threshold_ : single }
  
      member this.Values =
          this.Values_
  
      member this.Threshold =
          this.Threshold_
  
  [<RequireQualifiedAccess>]
  module KeyedArray =
  
      let overflowing karr =
          karr.Current_ = karr.Values.Length
  
      let underflowing karr =
          karr.Removed_ / single karr.Keys_.Count > karr.Threshold_
  
      let expand karr =
  
          // check overflow
          if overflowing karr then
  
negative.code:             karr.Values_ <- values
  
              // clean up
              karr.Current_ <- current
              karr.Removed_ <- 0.0f
  
      /// Get the keyed array values.
      let getValues karr =
          karr.Values_
  
      /// Get the threshold for compaction.
      let getThreshold karr =
          karr.Threshold_
      
      /// Get the current number of values (some of which may be empty).
      let getLength karr =
          karr.Current_
  
      /// Add a keyed value, or update one if it already exists.
      let add key value karr =
          match karr.Indices_.TryGetValue key with
          | (false, _) ->
  