anchor.diff:      end.
   
   id(X) -> X.
  +
  +throw_arg_exn() ->
  +    throw({'System.ArgumentException',
  +           "The input sequence has an insufficient number of elements."}).
  +
  +throw_key_not_found_exn() ->
  +    throw({'System.Collections.Generic.KeyNotFoundException', "Key not found"}).
  +
  +throw_invalid_op_exn() ->
  +    throw({'System.InvalidOperationException',
  +           "invalid operation"}).
   
   -ifdef(TEST).
   -include_lib("eunit/include/eunit.hrl").
  
positive.code: singleton(Item) ->
      {seq, {list, [Item]}}.
  
  map(F, Seq) ->
      {seq, {map, F, seq(Seq)}}.
  
  exists(F, Seq) ->
      find_internal(seq(Seq), F) =/= undefined.
  
negative.code: 
  %%% ------- internal -------
  
  item_internal(0, Seq0) ->
      case next(Seq0) of
          finished ->
              throw_arg_exn();
          {Item, _Seq} ->
              Item
      end;
  item_internal(Num, Seq0) ->
      case next(Seq0) of
          finished ->
              throw_arg_exn();
          {_Item, Seq} ->
              item_internal(Num-1, Seq)
      end.
  
  find_internal(Enum0, F) ->
      find_internal0(Enum0, 0, F).
  
  