 
   @doc """
   Folds a list of document entities into a document entity
-  using a function that is passed as the first argument.
-
-  ## Examples
-
-      iex> doc = ["A", "B"]
-      iex> doc = Inspect.Algebra.fold_doc(doc, fn(x, y) ->
-      ...>   Inspect.Algebra.concat [x, "!", y]
+  using the given folder function.
+
+  The list of document is folded "from the right"; in that, this function is
+  similar to `List.foldr/3`, except that it doesn't expect an initial
+  accumulator and uses the last element of `docs` as the initial accumulator.
+
+  ## Examples
+
+      iex> doc = ["A", "B", "C"]
+      iex> doc = Inspect.Algebra.fold_doc(doc, fn(d, acc) ->
+      ...>   Inspect.Algebra.concat([d, "!", acc])
       ...> end)
       iex> Inspect.Algebra.format(doc, 80)
-      ["A", "!", "B"]
+      ["A", "!", "B", "!", "C"]
 
   """
   @spec fold_doc([t], ((t, t) -> t)) :: t

      printing to IO devices. Set to 0 to force each item to be printed on its
      own line.

    * `:base` - prints integers as :binary, :octal, :decimal, or :hex, defaults
      to :decimal. When inspecting binaries any `:base` other than `:decimal`
      implies `binaries: :as_binaries`.

    * `:safe` - when `false`, failures while inspecting structs will be raised

  @doc ~S"""
  Surrounds a document with characters.

  Puts the given document `doc` between the `left` and `right` strings enclosing
  and nesting it. The document is marked as a group, to show the maximum as
  possible concisely together.

  ## Examples

