anchor.diff:  to_form(Head, Form) ->
      to_form(200, Head, Form).
   
  +to_form(Code, Head, {ok, Form}) ->
  +   to_form(Code, Head, Form);
  +
  +to_form(_, Head, {error, Reason}) ->
  +   to_error(Reason, Head);
  +
   to_form(Code, Head, Form) ->
      [either ||
         restd_codec:encode_form(Form),
  
positive.code: to_text(Head, Text) ->
     to_json(200, Head, Text).
  
  to_text(Code, Head, Text) ->
     {ok,
        {Code, [{<<"Content-Type">>, <<"text/plain">>} | Head], scalar:s(Text)}
  
negative.code: 
  as_form(#request{entity = Entity}) ->
     restd_codec:decode_form(Entity).
  
  %%
  %% encode error to HTTP failure
  %% @todo: support https://tools.ietf.org/html/rfc7807 
  to_error(Reason, Head) ->
     {ok,
        {Reason, Head, <<>>}
     }.
  
  
  %%%----------------------------------------------------------------------------   
  %%%
  