anchor.diff:          pathField.SetValue(uri, uriInfo.Path)
           queryField.SetValue(uri, uriInfo.Query)
   
  -        uri))
  +        uri)
   
  -let private isMono =
  -    let uriType = typeof<Uri>
  -    (uriType.GetField("m_Flags", privateInstanceFlags) = null)
  +let private isMono = typeof<Uri>.GetField("m_Flags", privateInstanceFlags) = null
   
   let private hasBrokenDotNetUri =
       if isMono then false
       else
  -        let uriType = typeof<Uri>
  -        //ShouldUseLegacyV2Quirks was introduced in .net 4.5
  -        //Eventhough 4.5 is an inplace update of 4.0 this call will return 
  -        //a different value if an application specifically targets 4.0 or 4.5+
  -        let legacyV2Quirks = uriType.GetProperty("ShouldUseLegacyV2Quirks", BindingFlags.Static ||| BindingFlags.NonPublic)
  +        // ShouldUseLegacyV2Quirks was introduced in .net 4.5
  +        // Eventhough 4.5 is an inplace update of 4.0 this call will return 
  +        // a different value if an application specifically targets 4.0 or 4.5+
  +        let legacyV2Quirks = typeof<Uri>.GetProperty("ShouldUseLegacyV2Quirks", BindingFlags.Static ||| BindingFlags.NonPublic)
           match legacyV2Quirks with
           | null -> true //neither 4.0 or 4.5
           | _ ->
               let isBrokenUri = unbox (legacyV2Quirks.GetValue(null, null))
               if not isBrokenUri then false //application targets 4.5
               else
  -                //4.0 uses legacyV2quirks on the UriParser but you can set
  -                //  <uri>
  -                //    <schemeSettings>
  -                //      <add name="http" genericUriParserOptions="DontUnescapePathDotsAndSlashes" />
  -                //          </schemeSettings>
  -                //  </uri>
  +                // 4.0 uses legacyV2quirks on the UriParser but you can set
  +                // <uri>
  +                //   <schemeSettings>
  +                //     <add name="http" genericUriParserOptions="DontUnescapePathDotsAndSlashes" />
  +                //   </schemeSettings>
  +                // </uri>
                   //
                   //  this will fix AbsoluteUri but not ToString()
                   //  i.e new Uri("http://google.com/%2F").AbsoluteUri
  
positive.code: let private publicInstanceFlags = BindingFlags.Public ||| BindingFlags.Instance
  
  let private purifierDotNet = lazy(
      let uriType = typeof<Uri>
      let flagsField = uriType.GetField("m_Flags", privateInstanceFlags)
      let stringField = uriType.GetField("m_String", privateInstanceFlags)
  
negative.code:                 let uri = new Uri("http://google.com/%2F")
                  uri.ToString().EndsWith("%2F", StringComparison.InvariantCulture)
  
  let enableUriSlashes =
      if isMono then purifierMono.Force()
      elif hasBrokenDotNetUri then purifierDotNet.Force()
      else id
  
  #endif