anchor.diff:          | SText of int * string * SimpleDoc
           | SLine of int * SimpleDoc
   
  +    /// The empty document.
       let empty = Empty
   
       let line = Line false
   
       let linebreak = Line true
   
  +    /// Lift a string into the Doc type.
       let text (s:string) =
           match s.Length with
           | 0 -> Empty
           | l -> Text (l, s)
   
  +    /// Place two documents side-by-side
       let beside x y = Cat (x,y)
   
  -    // in haskell this is <>, but this collides poorly with <> in F#
  +    /// Infix notation for beside.  In haskell this is <>, but this collides 
  +    /// poorly with <> in F# so it was renamed.
       let inline (<<>>) (x:Doc) (y:Doc) = beside x y
   
       // to avoid issues with existing functions like int and float
       // those are renamed to mkint and mkfloat.  then, to keep these
       // functions consistent, the others are also prefaced with "mk"
   
  +    /// Given a string with one or more lines of text separated by newline
  +    /// characters, create a sequence of Doc objects for each line and then
  +    /// fold the resulting Doc objects together with the <<>> operator
  +    /// with a line between each.
       let rec mkstring (s:string) =
           let parts = s.Split([|'\n'|])
                       |> Array.map text
  
positive.code: 
      let align d = column (fun k -> nesting (fun i -> nest (k-i) d))
  
      let encloseSep left right sep ds =
          match ds with
          | []    -> left <<>> right
  
negative.code:         | _ -> Array.fold (fun (x:Doc) (y:Doc) -> x <<>> line <<>> y)
                            parts.[0] parts.[1..]
  
      /// Lift a char into the Doc type.
      let mkchar c =
          match c with
          | '\n' -> line
          | c -> Char c
  
      /// Lift a bool into the Doc type.
      let mkbool = function
          | true -> text "True"
          | false -> text "False"
  
      /// Lift an integer into the Doc type.
      let mkint (i:int) = string i |> text
  
      /// Lift a float into the Doc type.
      let mkfloat (f:float) = string f |> text
  
      /// Lift a double into the Doc type.
      let mkdouble (d:double) = string d |> text
  
      /// '.' character.
      let dot       = mkchar '.'
  
      /// '\' character.
      let backslash = mkchar '\\'
  
      /// '=' character.
      let equals    = mkchar '='
  
      /// ' ' character.
      let space     = mkchar ' '
  
      /// ',' character.
      let comma     = mkchar ','
  
      /// ':' character.
      let colon     = mkchar ':'
  
      /// ';' character.
      let semi      = mkchar ';'
  
      /// '"' character.
      let dquote    = mkchar '"' // hacky fix for syntax highligher stupidity -> "
  
      /// ''' character.
      let squote    = mkchar '\''
  
      /// ']' character.
      let rbracket  = mkchar ']'
  
      /// '[' character.
      let lbracket  = mkchar '['
  
      /// '}' character.
      let rbrace    = mkchar '}'
  
      /// '{' character.
      let lbrace    = mkchar '{'
  
      /// ')' character.
      let rparen    = mkchar ')'
  
      /// '(' character.
      let lparen    = mkchar '('
  
      /// '>' character.
      let rangle    = mkchar '>'
  
      /// '<' character.
      let langle    = mkchar '<'
  
      /// Produce a string with n spaces.
      let spaces = function
          | n when n <= 0 -> ""
          | n             -> String.replicate n " "
  
      /// Indentation is an alias for spaces.
      let indentation = spaces
  
      /// Concatenate two Doc objects, separated by a single space.
      let inline (<+>) (x:Doc) (y:Doc) = x <<>> space <<>> y
  
      /// Fold specialized to Doc types.  Accepts only functions of type Doc -> Doc -> Doc,
      /// and returns the empty Doc when an empty list is provided.
      let fold f = function
          | []    -> empty
          | x::xs -> List.fold f x xs
  
      /// Concatenate two Doc objects, separating them with a line.  This function was <$>
      /// in Haskell.
      let inline (<*>) x y = x <<>> line <<>> y
  
      /// Concatenate two Doc objects, separating them with a line break.  This function was <$$>
      /// in Haskell.
      let inline (<**>) x y = x <<>> linebreak <<>> y
  
      /// Vertical concatenation of a list of Docs.
      let vcat = fold (<**>)
  
      // break in Haskell is isbreak in F# due to reserved word collision
  