anchor.diff:  open System
   open System.Collections.Concurrent
   
  -[<AbstractClass>]
  -[<CompilerMessageAttribute("This API supports the FSharp.Data.SqlClient infrastructure and is not intended to be used directly from your code.", 101, IsHidden = true)>]
  -type SingleRootTypeProvider(config: TypeProviderConfig, providerName, parameters, ?isErased) as this = 
  -    inherit TypeProviderForNamespaces()
  -
  +type CacheWithMonitors (providerName) =
       //cache
       let changeMonitors = ConcurrentBag()
       [<VolatileField>]
  -    let mutable clearingCache = false
  +    let mutable isDisposing = false
       let cache = new MemoryCache(providerName)
   
  -    let clearCache() = 
  -        clearingCache <- true
  +    member x.ClearCache() = 
           while not changeMonitors.IsEmpty do
               let removed, (monitor: CacheEntryChangeMonitor) =  changeMonitors.TryTake()
               if removed then monitor.Dispose()
  
positive.code:             then 
                  let m = cache.CreateCacheEntryChangeMonitor [ key ]
                  m.NotifyOnChanged(fun _ -> 
                      if not clearingCache 
                      then 
                          clearCache()
                          this.Invalidate()
                  )
                  changeMonitors.Add(m)
                  value 
  
negative.code:             parameters = parameters,             
              instantiationFunction = fun typeName args ->
                  let typ, monitors = this.CreateRootType(assembly, nameSpace, typeName, args)
                  cache.CacheGetOrAdd(typeName, typ, monitors |> Seq.cast, this.Invalidate)
          )
  
          this.AddNamespace( nameSpace, [ providerType ])
  
      do
          this.Disposing.Add <| fun _ -> (cache :> IDisposable).Dispose()
  
      abstract CreateRootType: assemblyName: Assembly * nameSpace: string * typeName: string  * args: obj[] -> Lazy<ProvidedTypeDefinition> * obj[] // ChangeMonitor[] underneath but there is a problem https://github.com/fsprojects/FSharp.Data.SqlClient/issues/234#issuecomment-240694390
  