anchor.diff:  
   [<AutoOpen>]
   module PPrint =
  -  let delay th = LAZY ^ Lazy.Create th
  -
  -  let empty = EMPTY
  +  let delay th = Lazy ^ Lazy.Create th
  +
  +  let empty = Empty
     let space = space
     let line = line
     let linebreak = linebreak
     let softline = softline
     let softbreak = softbreak
   
  -  let column i2d = COLUMN i2d
  -  let nesting i2d = NESTING i2d
  -
  -  let txt s = TEXT s
  -  let user (x: obj) = USER x
  -  let fmt f = Printf.ksprintf TEXT f
  -  let chr (c: char) = TEXT ^ string c
  -
  -  let lparen = TEXT "("
  -  let rparen = TEXT ")"
  -  let lrparen = (lparen, rparen)
  -  let langle = TEXT "<"
  -  let rangle = TEXT ">"
  -  let lrangle = (langle, rangle)
  -  let lbrace = TEXT "{"
  -  let rbrace = TEXT "}"
  -  let lrbrace = (lbrace, rbrace)
  -  let lbracket = TEXT "["
  -  let rbracket = TEXT "]"
  -  let lrbracket = (lbracket, rbracket)
  -  let squote = TEXT "'"
  +  let inline column' withCol = With ^ fun col _ -> withCol col
  +  let inline nesting' withNest = With ^ fun _ prefix -> withNest prefix.Length
  +
  +  let column withCol = column' withCol
  +  let nesting withNest = nesting' withNest
  +
  +  let txt s = Text s
  +  let user (x: obj) = User x
  +  let fmt f = Printf.ksprintf Text f
  +  let chr (c: char) = Text ^ string c
  +
  +  let (lparen,   rparen)   as lrparen   = (Text "(", Text ")")
  +  let (langle,   rangle)   as lrangle   = (Text "<", Text ">")
  +  let (lbrace,   rbrace)   as lrbrace   = (Text "{", Text "}")
  +  let (lbracket, rbracket) as lrbracket = (Text "[", Text "]")
  +  let squote = Text "'"
     let lrsquote = (squote, squote)
  -  let dquote = TEXT "\""
  +  let dquote = Text "\""
     let lrdquote = (dquote, dquote)
  -  let semi = TEXT ";"
  -  let colon = TEXT ":"
  -  let comma = TEXT ","
  -  let dot = TEXT "."
  -  let backslash = TEXT "\\"
  -  let equals = TEXT "="
  +
  +  let semi      = Text ";"
  +  let colon     = Text ":"
  +  let comma     = Text ","
  +  let dot       = Text "."
  +  let backslash = Text "\\"
  +  let equals    = Text "="
   
     let punctuate sep (ds: seq<Doc>) = seq {
       use ds = ds.GetEnumerator ()
       if ds.MoveNext () then
  -      let d = ref ds.Current
  +      let mutable d = ds.Current
         while ds.MoveNext () do
  -        yield !d <^> sep
  -        d := ds.Current
  -      yield !d
  +        yield d <^> sep
  +        d <- ds.Current
  +      yield d
     }
   
  -  let spaces n = String.replicate n " "
  -
  -  let nestBy s d = NEST (s, d)
  +  let inline spaces n = String.replicate n " "
  +
  +  let nestBy s d = Nest (s, d)
     let nest n = nestBy ^ spaces n
   
  -  let align d = column ^ fun k -> nesting ^ fun i -> d |> nest ^ k-i
  +  let align d = With ^ fun c p -> d |> nest ^ c-p.Length
     let hang i d = align ^ nest i d
     let indent i d = txt ^ spaces i <^> d |> hang i
   
  -  let width d f = column ^ fun l -> d <^> column ^ fun r -> f ^ r-l
  -
  -  let mkFill p t f d =
  -    width d ^ fun w -> if p f w then t f else txt ^ spaces ^ f-w
  +  let inline width' d f = column' ^ fun l -> d <^> column' ^ fun r -> f ^ r-l
  +  let width d f = width' d f
  +
  +  let inline mkFill p t f d =
  +    width' d ^ fun w -> if p f w then t f else txt ^ spaces ^ f-w
   
     let fillBreak n d = mkFill (<) (flip nest linebreak) n d
     let fill n d = mkFill (<=) (K empty) n d
   
     let rec flatten doc = delay ^ fun () ->
       match doc with
  -     | LAZY doc -> flatten ^ force doc
  -     | JOIN (lhs, rhs) -> JOIN (flatten lhs, flatten rhs)
  -     | NEST (txt, doc) -> NEST (txt, flatten doc)
  -     | EMPTY | TEXT _ | USER _ -> doc
  -     | LINE b -> if b then empty else space
  -     | CHOICE (wide, _) -> wide
  -     | COLUMN f -> COLUMN (flatten << f)
  -     | NESTING f -> NESTING (flatten << f)
  -  let choice wide narrow = CHOICE (flatten wide, narrow)
  -  let group doc = CHOICE (flatten doc, doc)
  +     | Lazy doc -> flatten ^ force doc
  +     | Join (lhs, rhs) -> Join (flatten lhs, flatten rhs)
  +     | Nest (txt, doc) -> Nest (txt, flatten doc)
  +     | Empty | Text _ | User _ -> doc
  +     | Line wide -> wide
  +     | Choice (wide, _) -> wide
  +     | With f -> With <| fun c p -> f c p |> flatten
  +
  +  let choice wide narrow = Choice (flatten wide, narrow)
  +  let group doc = choice doc doc
   
     let gnest n = group >> nest n
   
  
positive.code: open System.IO
  
  type Doc =
    | EMPTY
    | LAZY of Lazy<Doc>
    | LINE of bool
    | JOIN of lhs: Doc * rhs: Doc
    | NEST of string * Doc
    | TEXT of string
    | CHOICE of wide: Doc * narrow: Doc
    | COLUMN of (int -> Doc)
    | NESTING of (int -> Doc)
    | USER of obj
  
  [<AutoOpen>]
  module Consts =
    let space = TEXT " "
    let line = LINE false
    let linebreak = LINE true
    let softline = CHOICE (space, line)
    let softbreak = CHOICE (EMPTY, linebreak)
  
    let inline joinWith d l r = JOIN (l, JOIN (d, r))
  
  type Doc with
    static member (<^>) (l, r) = JOIN (l, r)
    static member (<+>) (l, r) = joinWith space l r
    static member (<.>) (l, r) = joinWith line l r
    static member (</>) (l, r) = joinWith softline l r
    static member (<..>) (l, r) = joinWith linebreak l r
    static member (<//>) (l, r) = joinWith softbreak l r
  
  [<AutoOpen>]
  module Util =
  
negative.code: 
    let rec output (actions: Actions) doc =
      match force doc with
       | Nil -> ()
       | Print (str, doc) ->
         actions.Write str
         output actions doc
       | Obj (obj, doc) ->
         actions.User obj
         output actions doc
       | Linefeed (prefix, doc) ->
         actions.Line ()
         actions.Write prefix
         output actions doc
  
    let rec fits maxCols usedCols doc =
      usedCols <= maxCols &&
      match force doc with
       | Nil | Linefeed _ -> true
       | Obj (_, doc) ->
         fits maxCols usedCols doc
       | Print (str, doc) ->
         fits maxCols (usedCols + str.Length) doc
  
    type Docs =
      | Done
      | Docs of string * Doc * Docs
  
    let rec layout maxColsOr0 usedCols = function
      | Done -> Nil
      | Docs (prefix, doc, rest) ->
        match doc with
         | Lazy doc ->
           layout maxColsOr0 usedCols ^ Docs (prefix, force doc, rest)
         | Empty ->
           layout maxColsOr0 usedCols rest
         | Join (lhs, rhs) ->
           layout maxColsOr0 usedCols ^
           Docs (prefix, lhs, Docs (prefix, rhs, rest))
         | Nest (txt, doc) ->
           layout maxColsOr0 usedCols ^ Docs (prefix + txt, doc, rest)
         | Text str ->
           Print (str, lazy layout maxColsOr0 (usedCols + str.Length) rest)
         | User obj ->
           Obj (obj, lazy layout maxColsOr0 usedCols rest)
         | Line _ ->
           Linefeed (prefix, lazy layout maxColsOr0 prefix.Length rest)
         | Choice (wide, narrow) ->
           let wide = layout maxColsOr0 usedCols ^ Docs (prefix, wide, rest)
           if maxColsOr0 = 0 || fits maxColsOr0 usedCols ^ lazy wide
           then wide
           else layout maxColsOr0 usedCols ^ Docs (prefix, narrow, rest)
         | With f ->
           layout maxColsOr0 usedCols ^ Docs (prefix, f usedCols prefix, rest)
  
    let outputWithActions actions maxCols doc =
      let maxColsOr0 =
  