anchor.diff:           build_encoded_form_rfc1738/1, shuffle/1, gsplit/2]).
   
   %%====================================================================
  -%% API
  -%%====================================================================
   
  -%%--------------------------------------------------------------------
  -%% Function: gsplit(N, L1) -> {L2, L3}
  -%% Description:
  -%%    types: N          - integer()
  -%%           L1, L2, L3 - list()
  -%%
  -%%   Graceful split. Works is lists:split, but if N is greater than
  -%%     length(L1) then L1 =:= L2 and L3 = []
  -%%--------------------------------------------------------------------
  +%% @doc Graceful split.
  +%% Works like lists:split, but if N is greater than length(L1), then
  +%% it will return L1 =:= L2 and L3 = []. This will gracefully make it
  +%% ignore out-of-items situations.
  +%% @end
  +-spec gsplit(integer(), [term()]) -> {[term()], [term()]}.
   gsplit(N, L) ->
       gsplit(N, L, []).
   
  
positive.code: build_encoded_form_rfc1738(Binary) when is_binary(Binary) ->
      build_encoded_form_rfc1738(binary_to_list(Binary)).
  
  %%--------------------------------------------------------------------
  %% Function: shuffle(List1) -> List2
  %% Description: Permute List1 randomly. Returns the permuted list.
  %%--------------------------------------------------------------------
  shuffle(List) ->
      merge_shuffle(List).
  
  %%====================================================================
  %% Internal functions
  %%====================================================================
  
  rfc_3986_unreserved_characters() ->
  
negative.code: merge_shuffle(List) ->
      {A, B} = partition(List),
      merge(merge_shuffle(A), merge_shuffle(B)).
  