           | doc_break
           | doc_group
           | doc_color
-          | doc_force_break
-          | doc_cancel_break
+          | doc_force
+          | doc_cancel
 
   @typep doc_string :: {:doc_string, t, non_neg_integer}
   defmacrop doc_string(string, length) do

  @tail_separator " |"
  @newline "\n"
  @break :flex

  # Functional interface to "doc" records


  #   * break - represents a fitted document with breaks as breaks
  #   * flat - represents a fitted document with breaks as flats
  #   * cancel - represents a document being fitted that will cancel (fit) the next break
  #   * no_cancel - represents a document being fitted that will not accept cancelations
  #
  @typep mode :: :break | :flat | :cancel | :no_cancel

  @spec fits?(integer, integer, [{integer, mode, t}]) :: boolean
  defp fits?(w, k, _) when k > w,                            do: false
  defp fits?(_, _, []),                                      do: true

  defp fits?(w, k, [{i, _, doc_cancel(x, :disabled)} | t]),  do: fits?(w, k, [{i, :no_cancel, x} | t])
  defp fits?(w, k, [{i, :no_cancel, doc_group(x)} | t]),     do: fits?(w, k, [{i, :no_cancel, x} | t])
  defp fits?(w, k, [{i, :no_cancel, doc_cancel(x, _)} | t]), do: fits?(w, k, [{i, :no_cancel, x} | t])

  defp fits?(w, k, [{i, _, doc_cancel(x, :enabled)} | t]),   do: fits?(w, k, [{i, :cancel, x} | t])
  defp fits?(w, k, [{i, :cancel, doc_force(x)} | t]),        do: fits?(w, k, [{i, :cancel, x} | t])
  defp fits?(w, k, [{i, :cancel, doc_group(x)} | t]),        do: fits?(w, k, [{i, :cancel, x} | t])
  defp fits?(_, _, [{_, :cancel, doc_break(_, _)} | _]),     do: true
  defp fits?(_, _, [{_, :cancel, :doc_line} | _]),           do: true

  defp fits?(w, k, [{_, _, :doc_nil} | t]),                  do: fits?(w, k, t)
  defp fits?(w, _, [{i, _, :doc_line} | t]),                 do: fits?(w, i, t)
  defp fits?(w, k, [{i, m, doc_cons(x, y)} | t]),            do: fits?(w, k, [{i, m, x} | [{i, m, y} | t]])
  defp fits?(w, k, [{i, m, doc_color(x, _)} | t]),           do: fits?(w, k, [{i, m, x} | t])
  defp fits?(w, k, [{i, m, doc_nest(x, _, :break)} | t]),    do: fits?(w, k, [{i, m, x} | t])
  defp fits?(w, k, [{i, m, doc_nest(x, j, _)} | t]),         do: fits?(w, k, [{apply_nesting(i, k, j), m, x} | t])
  defp fits?(w, k, [{i, _, doc_group(x)} | t]),              do: fits?(w, k, [{i, :flat, x} | t])
  defp fits?(w, k, [{_, _, doc_string(_, l)} | t]),          do: fits?(w, k + l, t)
  defp fits?(w, k, [{_, _, s} | t]) when is_binary(s),       do: fits?(w, k + byte_size(s), t)
  defp fits?(_, _, [{_, _, doc_force(_)} | _]),              do: false
  defp fits?(_, _, [{_, :break, doc_break(_, _)} | _]),      do: true
  defp fits?(w, k, [{_, _, doc_break(s, _)} | t]),           do: fits?(w, k + byte_size(s), t)

  @spec format(integer | :infinity, integer, [{integer, mode, t}]) :: [binary]
  defp format(_, _, []),                                do: []
