anchor.diff: -// --------------------------------------------------------------------------------------
  +// -----------------------------------------------------------------------------
   // BSON type provider - methods that are called from the generated erased code
  -// --------------------------------------------------------------------------------------
  +// -----------------------------------------------------------------------------
  +
   namespace BsonProvider.Runtime
   
   open System
   open System.ComponentModel
  -open System.Globalization
   open System.IO
   open MongoDB.Bson
   open MongoDB.Bson.Serialization
  -open FSharp.Data
  -open FSharp.Data.Runtime
   open FSharp.Data.Runtime.StructuralTypes
   
   #nowarn "10001"
  
positive.code: 
          | _ -> failwithf "Cannot create BsonValue from %A" value
  
      /// Creates a BsonValue and wraps it in a bson top
      static member CreateValue value =
          let bson = BsonRuntime.ToBsonValue value
          BsonTop.Create(bson, "")
  
      /// Creates a BsonDocument and wraps it in a bson top
      static member CreateDocument properties =
          let inline bDoc (x:seq<BsonElement>) = BsonDocument(x)
          let bson =
              properties
              |> Array.map (fun (k, v) -> BsonElement(k, BsonRuntime.ToBsonValue v))
              |> bDoc
  
          BsonTop.Create(bson, "")
  
      /// Creates a BsonArray and wraps it in a bson top
      static member CreateArray elements =
          let inline bArray (x:BsonValue[]) = BsonArray(x)
          let bson =
              elements
              |> Array.collect (BsonRuntime.ToBsonValue >> (fun value ->
                  match value.BsonType with
                  | BsonType.Array -> Array.ofSeq value.AsBsonArray.Values
                  | BsonType.Null -> [| |]
                  | _ -> [| value |]))
              |> bArray
  
          BsonTop.Create(bson, "")
  
negative.code: /// Static helper methods called from the generated code for working with BSON
  type BsonRuntime =
  
      // -------------------------------------------------------------------------
      // bson option -> type
      // -------------------------------------------------------------------------
      // Note that need we to specify the conversion functions as eta-expanded,
      // i.e. ConvertXX value = value |> Option.bind BsonConversions.AsXX
      // (instead of ConvertYY = Option.bind BsonConversions.AsYY), so that their
      // usage within quotations generates an Expr.Call, and not an Expr.Application
      // since the latter cannot be with AssemblyReplacer.replaceExpr.
  
      static member ConvertString value = value |> Option.bind BsonConversions.AsString
  
  