anchor.diff:          |> Seq.toArray
           |> Array.iter (cache.Remove >> ignore)
   
  -    let cacheGetOrAdd(key, value: Lazy<ProvidedTypeDefinition>, monitors) = 
  +    member x.CacheGetOrAdd(key, value: Lazy<ProvidedTypeDefinition>, monitors, invalidate) = 
           let policy = CacheItemPolicy()
           monitors |> Seq.iter policy.ChangeMonitors.Add
           let existing = cache.AddOrGetExisting(key, value, policy)
  
positive.code:             then 
                  let m = cache.CreateCacheEntryChangeMonitor [ key ]
                  m.NotifyOnChanged(fun _ -> 
                      if not clearingCache 
                      then 
                          clearCache()
                          this.Invalidate()
                  )
                  changeMonitors.Add(m)
                  value 
  
negative.code: open System
  open System.Collections.Concurrent
  
  type CacheWithMonitors (providerName) =
      //cache
      let changeMonitors = ConcurrentBag()
      [<VolatileField>]
      let mutable isDisposing = false
      let cache = new MemoryCache(providerName)
  
      member x.ClearCache() = 
          while not changeMonitors.IsEmpty do
              let removed, (monitor: CacheEntryChangeMonitor) =  changeMonitors.TryTake()
              if removed then monitor.Dispose()
  