anchor.diff:          pairs |> Seq.map (writeObject f) |> ignore
   
       let headerLineFunc builder (k:string, v:string) =
  -        Printf.bprintf builder "%O: %s\r\n" k v
  -
  -module HttpHeaders =
  -    [<CompiledName("Accept")>]
  -    let accept = Header.Create("Accept")
  -
  -    [<CompiledName("AcceptCharset")>]
  -    let acceptCharset = Header.Create("Accept-Charset")
  -
  -    [<CompiledName("AcceptEncoding")>]
  -    let acceptEncoding = Header.Create("Accept-Encoding")
  -
  -    [<CompiledName("AcceptLanguage")>]
  -    let acceptLanguage = Header.Create("Accept-Language")
  -
  -    [<CompiledName("AcceptRanges")>]
  -    let acceptRanges = Header.Create("Accept-Ranges")
  -
  -    [<CompiledName("Age")>]
  -    let age = Header.Create("Age")
  -
  -    [<CompiledName("Allow")>]
  -    let allow = Header.Create("Allow")
  -
  -    [<CompiledName("Authorization")>]
  -    let authorization = Header.Create("Authorization")
  -
  -    [<CompiledName("CacheControl")>]
  -    let cacheControl = Header.Create("Cache-Control")
  -
  -    [<CompiledName("Connection")>]
  -    let connection = Header.Create("Connection")
  -
  -    [<CompiledName("ContentEncoding")>]
  -    let contentEncoding = Header.Create("Content-Encoding")
  -
  -    [<CompiledName("ContentLanguage")>]
  -    let contentLanguage = Header.Create("Content-Language")
  -
  -    [<CompiledName("ContentLength")>]
  -    let contentLength = Header.Create("Content-Length")
  -
  -    [<CompiledName("ContentLocation")>]
  -    let contentLocation = Header.Create("Content-Location")
  -
  -    [<CompiledName("ContentMD5")>]
  -    let contentMD5 = Header.Create("Content-MD5")
  -
  -    [<CompiledName("ContentRange")>]
  -    let contentRange = Header.Create("Content-Range")
  -
  -    [<CompiledName("ContentType")>]
  -    let contentType = Header.Create("Content-Type")
  -
  -    [<CompiledName("Cookie")>]
  -    let cookie = Header.Create("Cookie")
  -
  -    [<CompiledName("Date")>]
  -    let date = Header.Create("Date")
  -
  -    [<CompiledName("ETag")>]
  -    let etag = Header.Create("ETag")
  -
  -    [<CompiledName("Expect")>]
  -    let expect = Header.Create("Expect")
  -
  -    [<CompiledName("Expires")>]
  -    let expires = Header.Create("Expires")
  -
  -    [<CompiledName("From")>]
  -    let from = Header.Create("From")
  -
  -    [<CompiledName("Host")>]
  -    let host = Header.Create("Host")
  -
  -    [<CompiledName("ifMatch")>]
  -    let ifMatch = Header.Create("If-Match")
  -
  -    [<CompiledName("IfModifiedSince")>]
  -    let ifModifiedSince = Header.Create("If-Modified-Since")
  -
  -    [<CompiledName("IfNoneMatch")>]
  -    let ifNoneMatch = Header.Create("If-None-Match")
  -
  -    [<CompiledName("IfRange")>]
  -    let ifRange = Header.Create("If-Range")
  -
  -    [<CompiledName("IfUnmodifiedSince")>]
  -    let ifUnmodifiedSince = Header.Create("If-Unmodified-Since")
  -
  -    [<CompiledName("LastModified")>]
  -    let lastModified = Header.Create("Last-Modified")
  -
  -    [<CompiledName("Location")>]
  -    let location = Header.Create("Location")
  -
  -    [<CompiledName("MaxForwards")>]
  -    let maxForwards = Header.Create("Max-Forwards")
  -
  -    [<CompiledName("Pragma")>]
  -    let pragma = Header.Create("Pragma")
  -
  -    [<CompiledName("ProxyAuthenticate")>]
  -    let proxyAuthenticate = Header.Create("Proxy-Authenticate")
  -
  -    [<CompiledName("ProxyAuthorization")>]
  -    let proxyAuthorization = Header.Create("Proxy-Authorization")
  -
  -    [<CompiledName("Range")>]
  -    let range = Header.Create("Range")
  -
  -    [<CompiledName("Referer")>]
  -    let referer = Header.Create("Referer")
  -
  -    [<CompiledName("RetryAfter")>]
  -    let retryAfter = Header.Create("Retry-After")
  -
  -    [<CompiledName("Server")>]
  -    let server = Header.Create("Server")
  -
  -    [<CompiledName("SetCookie")>]
  -    let setCookie = Header.Create("Set-Cookie")
  -
  -    [<CompiledName("TE")>]
  -    let te = Header.Create("TE")
  -
  -    [<CompiledName("Trailer")>]
  -    let trailer = Header.Create("Trailer")
  -
  -    [<CompiledName("TransferEncoding")>]
  -    let transferEncoding = Header.Create("Transfer-Encoding")
  -
  -    [<CompiledName("Upgrade")>]
  -    let upgrade = Header.Create("Upgrade")
  -
  -    [<CompiledName("UserAgent")>]
  -    let userAgent = Header.Create("User-Agent")
  -
  -    [<CompiledName("Vary")>]
  -    let vary = Header.Create("Vary")
  -
  -    [<CompiledName("Via")>]
  -    let via = Header.Create("Via")
  -
  -    [<CompiledName("Warning")>]
  -    let warning = Header.Create("Warning")
  -
  -    [<CompiledName("WwwAuthenticate")>]
  -    let wwwAuthenticate = Header.Create("WWW-Authenticate")
  -
  -    // Extension Headers
  -    [<CompiledName("XHttpMethod ")>]
  -    let xHttpMethod = Header.Create("X-HTTP-Method")
  -
  -    [<CompiledName("XHttpMethodOverride")>]
  -    let xHttpMethodOverride = Header.Create("X-HTTP-Method-Override")
  -
  -    [<CompiledName("XMethodOverride")>]
  -    let xMethodOverride = Header.Create("X-Method-Override")+        Printf.bprintf builder "%O: %s\r\n" k v
positive.code:           Header("Vary");
            Header("Via");
            Header("Warning");
            Header("WWW-Authenticate");
            Header("X-HTTP-Method");
            Header("X-HTTP-Method-Override");
            Header("X-Method-Override")] |> Seq.map (fun x -> (x.Normalized, x)) |> Map.ofSeq
      
      static member Create (header: string) = 
          match normalize header |> Header.StandardHeaders.TryFind with
          | Some header -> header
          | None ->
              match parse Header.Parser header with 
  
negative.code: 
      static member internal Parser = 
          HttpParsers.token |>> (fun header -> 
              match normalize header |> Header.CachedHeaders.TryFind with
              | Some header -> header
              | _ ->  Header(header))
  
  module HttpHeaders =
      [<CompiledName("Accept")>]
      let accept = Header.Create("Accept")
  
      [<CompiledName("AcceptCharset")>]
      let acceptCharset = Header.Create("Accept-Charset")
  
      [<CompiledName("AcceptEncoding")>]
      let acceptEncoding = Header.Create("Accept-Encoding")
  
      [<CompiledName("AcceptLanguage")>]
      let acceptLanguage = Header.Create("Accept-Language")
  
      [<CompiledName("AcceptRanges")>]
      let acceptRanges = Header.Create("Accept-Ranges")
  
      [<CompiledName("Age")>]
      let age = Header.Create("Age")
  
      [<CompiledName("Allow")>]
      let allow = Header.Create("Allow")
  
      [<CompiledName("Authorization")>]
      let authorization = Header.Create("Authorization")
  
      [<CompiledName("CacheControl")>]
      let cacheControl = Header.Create("Cache-Control")
  
      [<CompiledName("Connection")>]
      let connection = Header.Create("Connection")
  
      [<CompiledName("ContentEncoding")>]
      let contentEncoding = Header.Create("Content-Encoding")
  
      [<CompiledName("ContentLanguage")>]
      let contentLanguage = Header.Create("Content-Language")
  
      [<CompiledName("ContentLength")>]
      let contentLength = Header.Create("Content-Length")
  
      [<CompiledName("ContentLocation")>]
      let contentLocation = Header.Create("Content-Location")
  
      [<CompiledName("ContentMD5")>]
      let contentMD5 = Header.Create("Content-MD5")
  
      [<CompiledName("ContentRange")>]
      let contentRange = Header.Create("Content-Range")
  
      [<CompiledName("ContentType")>]
      let contentType = Header.Create("Content-Type")
  
      [<CompiledName("Cookie")>]
      let cookie = Header.Create("Cookie")
  
      [<CompiledName("Date")>]
      let date = Header.Create("Date")
  
      [<CompiledName("ETag")>]
      let etag = Header.Create("ETag")
  
      [<CompiledName("Expect")>]
      let expect = Header.Create("Expect")
  
      [<CompiledName("Expires")>]
      let expires = Header.Create("Expires")
  
      [<CompiledName("From")>]
      let from = Header.Create("From")
  
      [<CompiledName("Host")>]
      let host = Header.Create("Host")
  
      [<CompiledName("ifMatch")>]
      let ifMatch = Header.Create("If-Match")
  
      [<CompiledName("IfModifiedSince")>]
      let ifModifiedSince = Header.Create("If-Modified-Since")
  
      [<CompiledName("IfNoneMatch")>]
      let ifNoneMatch = Header.Create("If-None-Match")
  
      [<CompiledName("IfRange")>]
      let ifRange = Header.Create("If-Range")
  
      [<CompiledName("IfUnmodifiedSince")>]
      let ifUnmodifiedSince = Header.Create("If-Unmodified-Since")
  
      [<CompiledName("LastModified")>]
      let lastModified = Header.Create("Last-Modified")
  
      [<CompiledName("Location")>]
      let location = Header.Create("Location")
  
      [<CompiledName("MaxForwards")>]
      let maxForwards = Header.Create("Max-Forwards")
  
      [<CompiledName("Pragma")>]
      let pragma = Header.Create("Pragma")
  
      [<CompiledName("ProxyAuthenticate")>]
      let proxyAuthenticate = Header.Create("Proxy-Authenticate")
  
      [<CompiledName("ProxyAuthorization")>]
      let proxyAuthorization = Header.Create("Proxy-Authorization")
  
      [<CompiledName("Range")>]
      let range = Header.Create("Range")
  
      [<CompiledName("Referer")>]
      let referer = Header.Create("Referer")
  
      [<CompiledName("RetryAfter")>]
      let retryAfter = Header.Create("Retry-After")
  
      [<CompiledName("Server")>]
      let server = Header.Create("Server")
  
      [<CompiledName("SetCookie")>]
      let setCookie = Header.Create("Set-Cookie")
  
      [<CompiledName("TE")>]
      let te = Header.Create("TE")
  
      [<CompiledName("Trailer")>]
      let trailer = Header.Create("Trailer")
  
      [<CompiledName("TransferEncoding")>]
      let transferEncoding = Header.Create("Transfer-Encoding")
  
      [<CompiledName("Upgrade")>]
      let upgrade = Header.Create("Upgrade")
  
      [<CompiledName("UserAgent")>]
      let userAgent = Header.Create("User-Agent")
  
      [<CompiledName("Vary")>]
      let vary = Header.Create("Vary")
  
      [<CompiledName("Via")>]
      let via = Header.Create("Via")
  
      [<CompiledName("Warning")>]
      let warning = Header.Create("Warning")
  
      [<CompiledName("WwwAuthenticate")>]
      let wwwAuthenticate = Header.Create("WWW-Authenticate")
  
      // Extension Headers
      [<CompiledName("XHttpMethod ")>]
      let xHttpMethod = Header.Create("X-HTTP-Method")
  
      [<CompiledName("XHttpMethodOverride")>]
      let xHttpMethodOverride = Header.Create("X-HTTP-Method-Override")
  
      [<CompiledName("XMethodOverride")>]
      let xMethodOverride = Header.Create("X-Method-Override")
  
  module internal HeaderInternal =
      let internal headerSet = (Header.StandardHeaders :> IDictionary<string, Header>).Values |> Set.ofSeq
  
      let filterStandardHeaders (headers:Map<Header,obj>) =
          headers |> Map.toSeq |> (Seq.filter <| fun (k,v) -> headerSet.Contains k |> not) |> Map.ofSeq
  
      let headerMapFromRawHeaders (headers:seq<string*(string seq)>) =
          // FIXME: Special case cookies
          headers 
          |> Seq.map(fun (k,v) -> 
              let header = Header.Create k
              if header = HttpHeaders.setCookie then (header, v :> obj)
              else (header, String.Join (",", v) :> obj)) 
          |> Map.ofSeq
  
  