anchor.diff:  
       //
       [<CompiledName("OfSeq")>]
  -    let ofSeq (source : seq<'Key * 'T>) : LruCache<'Key, 'T> =
  +    let ofSeq (capacity : uint32) (source : seq<'Key * 'T>) : LruCache<'Key, 'T> =
           // Preconditions checked within the member.
  -        LruCache.OfSeq source
  +        LruCache.OfSeq (source, capacity)
   
       //
       [<CompiledName("OfList")>]
  -    let ofList (source : ('Key * 'T) list) : LruCache<'Key, 'T> =
  +    let ofList (capacity : uint32) (source : ('Key * 'T) list) : LruCache<'Key, 'T> =
           // Preconditions checked within the member.
  -        LruCache.OfList source
  +        LruCache.OfList (source, capacity)
   
       //
       [<CompiledName("OfArray")>]
  -    let ofArray (source : ('Key * 'T)[]) : LruCache<'Key, 'T> =
  +    let ofArray (capacity : uint32) (source : ('Key * 'T)[]) : LruCache<'Key, 'T> =
           // Preconditions checked within the member.
  -        LruCache.OfArray source
  +        LruCache.OfArray (source, capacity)
   
       //
       [<CompiledName("OfMap")>]
  -    let ofMap (source : Map<'Key, 'T>) : LruCache<'Key, 'T> =
  +    let ofMap (capacity : uint32) (source : Map<'Key, 'T>) : LruCache<'Key, 'T> =
           // Preconditions checked within the member.
  -        LruCache.OfMap source
  +        LruCache.OfMap (source, capacity)
   
       //
       [<CompiledName("ToSeq")>]
  
positive.code:         // Preconditions
          checkNonNull "cache" cache
          
          map.Choose chooser
  
      /// Applies the given function to each binding in the map.
      [<CompiledName("Iterate")>]
      let inline iter (action : 'Key -> 'T -> unit) (cache : LruCache<'Key, 'T>) : unit =
          // Preconditions
          checkNonNull "cache" cache
          
          map.Iterate action
  
      /// Applies the given function to each binding in the map.
      [<CompiledName("IterateBack")>]
      let inline iterBack (action : 'Key -> 'T -> unit) (cache : LruCache<'Key, 'T>) : unit =
          // Preconditions
          checkNonNull "cache" cache
  
          map.IterateBack action
  
      /// Folds over the bindings in the map.
      [<CompiledName("Fold")>]
      let inline fold (folder : 'State -> 'Key -> 'T -> 'State) (state : 'State) (cache : LruCache<'Key, 'T>) : 'State =
          // Preconditions
          checkNonNull "cache" cache
          
          map.Fold (folder, state)
  
      /// Folds over the bindings in the map.
      [<CompiledName("FoldBack")>]
      let inline foldBack (folder : 'Key -> 'T -> 'State -> 'State) (cache : LruCache<'Key, 'T>) (state : 'State) : 'State =
          // Preconditions
          checkNonNull "cache" cache
  
          map.FoldBack (folder, state)
  
      /// Determines if any binding in the map matches the specified predicate.
      [<CompiledName("Exists")>]
      let inline exists (predicate : 'Key -> 'T -> bool) (cache : LruCache<'Key, 'T>) : bool =
          // Preconditions
          checkNonNull "cache" cache
          
          map.Exists predicate
  
      /// Determines if all bindings in the map match the specified predicate.
      [<CompiledName("Forall")>]
      let inline forall (predicate : 'Key -> 'T -> bool) (cache : LruCache<'Key, 'T>) : bool =
          // Preconditions
          checkNonNull "cache" cache
  
          map.Forall predicate
  
      /// Splits the map into two maps containing the bindings for which the given
      /// predicate returns true and false, respectively.
      [<CompiledName("Partition")>]
      let inline partition (predicate : 'Key -> 'T -> bool) (cache : LruCache<'Key, 'T>) : LruCache<'Key, 'T> * LruCache<'Key, 'T> =
          // Preconditions
          checkNonNull "cache" cache
          
          map.Partition predicate
  
      /// Splits the map into two maps by applying the given partitioning function
      /// to each binding in the map.
      [<CompiledName("MapPartition")>]
      let inline mapPartition (partitioner : 'Key -> 'T -> Choice<'U, 'V>) (cache : LruCache<'Key, 'T>) : LruCache<'Key, 'U> * LruCache<'Key, 'V> =
          // Preconditions
          checkNonNull "cache" cache
  
          map.MapPartition partitioner
  *)
  
negative.code:     static member internal Create (capacity : uint32) : LruCache<'Key, 'T> =
          LruCache (HashMap.empty, IntMap.empty, capacity, 0u)
  
      //
      member __.TryPick (picker : 'Key -> 'T -> 'U option) : 'U option =
          // Adapt the picker for better performance.
          let picker = FSharpFunc<_,_,_>.Adapt picker
  
          // Traverse the elements in the cache from oldest to newest.
          indexedKeys
          |> IntMap.tryPick (fun _ key ->
              // Get the value from the cache.
              let kvp = HashMap.find key cache
  
              // Apply the picker to the key and value.
              picker.Invoke (key, kvp.Value))
  
      //
      member this.Pick (picker : 'Key -> 'T -> 'U option) : 'U =
          // Call TryPick, and raise an exception if no value is picked.
          match this.TryPick picker with
          | Some x -> x
          | None ->
              // TODO : Provide a better error message.
              // keyNotFound ""
              raise <| System.Collections.Generic.KeyNotFoundException ()
  
      //
      member __.Exists (predicate : 'Key -> 'T -> bool) : bool =
          // Adapt the predicate for better performance.
          let predicate = FSharpFunc<_,_,_>.Adapt predicate
  
          // Traverse the elements in the cache from oldest to newest.
          indexedKeys
          |> IntMap.exists (fun _ key ->
              // Get the value from the cache.
              let kvp = HashMap.find key cache
  
              // Apply the predicate to the key and value.
              predicate.Invoke (key, kvp.Value))
  
      //
      member __.Forall (predicate : 'Key -> 'T -> bool) : bool =
          // Adapt the predicate for better performance.
          let predicate = FSharpFunc<_,_,_>.Adapt predicate
  
          // Traverse the elements in the cache from oldest to newest.
          indexedKeys
          |> IntMap.forall (fun _ key ->
              // Get the value from the cache.
              let kvp = HashMap.find key cache
  
              // Apply the predicate to the key and value.
              predicate.Invoke (key, kvp.Value))
  
      //
      member this.Filter (predicate : 'Key -> 'T -> bool) : LruCache<'Key, 'T> =
          // Adapt the predicate for better performance.
          let predicate = FSharpFunc<_,_,_>.Adapt predicate
  
          // Remove the keys which don't match the predicate.
          (this, indexedKeys)
          ||> IntMap.fold (fun this _ key ->
              // Get the value from the cache.
              let kvp = HashMap.find key cache
  
              // Apply the predicate to the key and value;
              // if it doesn't match, remove the key.
              if predicate.Invoke (key, kvp.Value) then this
              else this.Remove key)
  
      //
      member this.Choose (chooser : 'Key -> 'T -> 'U option) : LruCache<'Key, 'U> =
          // Adapt the chooser for better performance.
          let chooser = FSharpFunc<_,_,_>.Adapt chooser
  
          // Remove the keys which aren't chosen, and create a new HashMap
          // to hold the chosen values.
          let cache, indexedKeys =
              ((HashMap.empty, indexedKeys), indexedKeys)
              ||> IntMap.fold (fun (chosenCache, indexedKeys) _ key ->
                  // Get the value from the cache.
                  let kvp = HashMap.find key cache
  
                  // Apply the chooser to the key and value;
                  // if it doesn't match, remove the key.
                  match chooser.Invoke (key, kvp.Value) with
                  | None ->
                      let indexedKeys' = IntMap.remove kvp.Key indexedKeys
                      chosenCache, indexedKeys'
                  | Some chosenValue ->
                      let chosenCache' =
                          HashMap.add key (KeyValuePair (kvp.Key, chosenValue)) chosenCache
                      chosenCache', indexedKeys)
  
          // Return a new cache with the updated maps.
          // OPTIMIZE : Only return a new cache if the maps were actually updated.
          LruCache (cache, indexedKeys, capacity, currentIndex)
  
      /// Apply a function to each key-value pair in the cache, in order from
      /// oldest (least-recently-used) to newest (most-recently-used).
      member this.Iterate (action : 'Key -> 'T -> unit) : unit =
          // Adapt the action for better performance.
          let action = FSharpFunc<_,_,_>.Adapt action
  
          // Iterate over the keys.
          indexedKeys
          |> IntMap.iter (fun _ key ->
              // Get the value from the cache.
              let kvp = HashMap.find key cache
  
              // Apply the action to the key and value.
              action.Invoke (key, kvp.Value))
  
      /// Apply a function to each key-value pair in the cache, in order from
      /// newest (most-recently-used) to oldest (least-recently-used).
      member this.IterateBack (action : 'Key -> 'T -> unit) : unit =
          // Adapt the action for better performance.
          let action = FSharpFunc<_,_,_>.Adapt action
  
          // Iterate over the keys.
          indexedKeys
          |> IntMap.iterBack (fun _ key ->
              // Get the value from the cache.
              let kvp = HashMap.find key cache
  
              // Apply the action to the key and value.
              action.Invoke (key, kvp.Value))
  
      /// Apply a function to each key-value pair in the cache, in order from
      /// oldest (least-recently-used) to newest (most-recently-used), threading an
      /// accumulator value through the computation.
      member this.Fold (folder : 'State -> 'Key -> 'T -> 'State, state : 'State) : 'State =
          // Adapt the folder for better performance.
          let folder = FSharpFunc<_,_,_,_>.Adapt folder
  
          // Fold over the keys.
          (state, indexedKeys)
          ||> IntMap.fold (fun state _ key ->
              // Get the value from the cache.
              let kvp = HashMap.find key cache
  
              // Apply the folder to the key and value and the current state value.
              folder.Invoke (state, key, kvp.Value))
  
      /// Apply a function to each key-value pair in the cache, in order from
      /// newest (most-recently-used) to oldest (least-recently-used), threading an
      /// accumulator value through the computation.
      member this.FoldBack (folder : 'Key -> 'T -> 'State -> 'State, state : 'State) : 'State =
          // Adapt the folder for better performance.
          let folder = FSharpFunc<_,_,_,_>.Adapt folder
  
          // Fold over the keys.
          (indexedKeys, state)
          ||> IntMap.foldBack (fun _ key state ->
              // Get the value from the cache.
              let kvp = HashMap.find key cache
  
              // Apply the folder to the key and value and the current state value.
              folder.Invoke (key, kvp.Value, state))
  
      /// Builds a new cache whose values are the results of applying the given function
      /// to each key-value pair in the cache. The key passed to the function indicates
      /// the key of the element being transformed.
      member this.Map (mapping : 'Key -> 'T -> 'U) : LruCache<'Key, 'U> =
          // Adapt the mapping for better performance.
          let mapping = FSharpFunc<_,_,_>.Adapt mapping
  
          // We fold over the cache-map (HashMap) here instead of the key-index (IntMap)
          // because it is faster than having to look up the value corresponding to each key.
          // However, this also means the mapping is not applied to the elements in
          // any particular order (oldest-to-newest or newest-to-oldest).
          let mappedCache =
              cache
              |> HashMap.map (fun key (KeyValue (keyIndex, value)) ->
                  // Apply the mapping to the key and value.
                  let mappedValue = mapping.Invoke (key, value)
  
                  // Return a new KeyValuePair with the key index and mapped value.
                  KeyValuePair (keyIndex, mappedValue))
  
          // Return a new cache with the mapped cache-map.
          LruCache (mappedCache, indexedKeys, capacity, currentIndex)
  
      //
      member this.Partition (predicate : 'Key -> 'T -> bool) : LruCache<'Key, 'T> * LruCache<'Key, 'T> =
          // Adapt the predicate for better performance.
          let predicate = FSharpFunc<_,_,_>.Adapt predicate
  
          notImpl "LruCache.Partition"
  
      //
      member this.MapPartition (partitioner : 'Key -> 'T -> Choice<'U, 'V>) : LruCache<'Key, 'U> * LruCache<'Key, 'V> =
          // Adapt the partitioner for better performance.
          let partitioner = FSharpFunc<_,_,_>.Adapt partitioner
  
          notImpl "LruCache.MapPartition"
  
  //
  [<RequireQualifiedAccess; CompilationRepresentation(CompilationRepresentationFlags.ModuleSuffix)>]
  