anchor.diff:  -module(docsh_embeddable).
   -compile([debug_info,
             {inline, [get_elixir_docs_v1/1,
  -                    do_with_docs/2,
  -                    do_with_supported/2,
  +                    do_with_docs/3,
  +                    do_with_supported/3,
                       types/1]}]).
   
   -export([h/1,
  -         h/3]).
  +         h/4]).
   
   -type fname() :: atom().
   
  
positive.code:         {error, _, {missing_chunk, _, _}} ->
              error({no_docs, <<"no ExDc chunk">>})
      end.
  
negative.code:                               "## Types~n~s~n",
                                [ModDoc, types(Docs)])
          end,
      do_with_docs(Mod, F, []).
  
  -spec h(module(), fname(), arity(), [term()]) -> ok.
  h(Mod, Fun, Arity, Opts) ->
      F = fun (Docs, Opts) ->
                  case fetch_function({Fun, Arity}, Docs) of
                      {no_docs, no_specs} ->
                          error({no_docs, <<"neither doc comments nor specs found">>});
                      {{doc, not_found}, {spec, not_found}} ->
                          error({no_docs, <<(mfa(Mod, Fun, Arity))/bytes, " not found">>});
                      {{doc, Doc}, {spec, Spec}} ->
                          format([ {doc, Doc}   || proplists:is_defined(doc, Opts) ] ++
                                 [ {spec, Spec} || proplists:is_defined(spec, Opts) ])
                  end
          end,
      do_with_docs(Mod, F, Opts).
  
  do_with_docs(Mod, Fun, Opts) ->
      T = try
              do_with_supported(Fun, get_elixir_docs_v1(Mod), Opts)
          catch
              error:{no_docs, R} ->
                  <<"Docs missing:", R/bytes>>;
              _:R ->
                  ?il2b([<<"docsh error: ">>,
                         io_lib:format("~p\n~p\n", [R, erlang:get_stacktrace()])])
          end,
      io:format("~s~n", [T]).
  
  do_with_supported(Fun, {elixir_docs_v1, Docs}, Opts) ->
      Fun(Docs, Opts);
  do_with_supported(_, _, _) ->
      <<"Documentation format not supported">>.
  
  fetch_function(_, _) ->
      not_implemented_yet.
  
  fetch_doc(FunArity, Docs) ->
      {doc, case lists:keyfind(FunArity, 1, Docs) of
                false -> not_found;
                {FunArity, _, _, Doc} -> Doc
            end}.
  
  fetch_spec(FunArity, Specs) ->
      {spec, case lists:keyfind(FunArity, 1, Specs) of
                 false -> not_found;
                 {FunArity, Spec} -> Spec
             end}.
  
  format(_) ->
      not_implemented_yet.
  
  types(Docs) ->
      Types = proplists:get_value(types, Docs, []),
  