anchor.diff:  
   % Binary %
   
  --type bin() :: {bin, bin, binary()}.
  --type bfunction() :: {bin, function, binary()}.
  --type uuid() :: {bin, uuid, binary()}.
  --type md5() :: {bin, md5, binary()}.
  --type userdefined() :: {bin, userdefined, binary()}.
  +%-type bin() :: {bin, bin, binary()}.
  +%-type bfunction() :: {bin, function, binary()}.
  +%-type uuid() :: {bin, uuid, binary()}.
  +%-type md5() :: {bin, md5, binary()}.
  +%-type userdefined() :: {bin, userdefined, binary()}.
   
   % Special %
   
  --type mongostamp() :: {mongostamp, integer(), integer()}.
  +%-type mongostamp() :: {mongostamp, integer(), integer()}.
   % 4-byte increment, 4-byte timestamp. 0 timestamp has special semantics
  --type minmaxkey() :: 'MIN_KEY' | 'MAX_KEY'.
  +%-type minmaxkey() :: 'MIN_KEY' | 'MAX_KEY'.
   % Special values that compare lower/higher than all other bson values
   
   % Regex %
   
  --type regex() :: {regex, utf8(), utf8()}.  % pattern and options
  +%-type regex() :: {regex, utf8(), utf8()}.  % pattern and options
   
   % Datetime %
   
  --type unixtime() :: {integer(), integer(), integer()}. % {MegaSecs, Secs, MicroSecs}
  +%-type unixtime() :: {integer(), integer(), integer()}. % {MegaSecs, Secs, MicroSecs}
   % Unix time in Erlang now/os:timstamp format, but only to millisecond precision when serialized.
   
  --spec timenow () -> unixtime(). % IO
  +%-spec timenow () -> unixtime(). % IO
   % Current unixtime to millisecond precision, ie. MicroSecs is always a multiple of 1000.
   timenow() -> ms_precision (os:timestamp()).
   
  --spec ms_precision (unixtime()) -> unixtime().
  +%-spec ms_precision (unixtime()) -> unixtime().
   % Truncate microsecs to millisecs since bson drops microsecs anyway, so time will be equal before and after serialization.
   ms_precision ({MegaSecs, Secs, MicroSecs}) ->
   	{MegaSecs, Secs, MicroSecs div 1000 * 1000}.
   
  --type unixsecs() :: integer(). % Unix Time in seconds
  -
  --spec secs_to_unixtime (unixsecs()) -> unixtime().
  +%-type unixsecs() :: integer(). % Unix Time in seconds
  +
  +%-spec secs_to_unixtime (unixsecs()) -> unixtime().
   secs_to_unixtime (UnixSecs) -> {UnixSecs div 1000000, UnixSecs rem 1000000, 0}.
   
  --spec unixtime_to_secs (unixtime()) -> unixsecs().
  +%-spec unixtime_to_secs (unixtime()) -> unixsecs().
   unixtime_to_secs ({MegaSecs, Secs, _}) -> MegaSecs * 1000000 + Secs.
   
   % Javascript %
   
  --type javascript() :: {javascript, document(), utf8()}.  % scope and code
  +%-type javascript() :: {javascript, document(), utf8()}.  % scope and code
   
   % ObjectId %
   
  --type objectid() :: {<<_:96>>}.
  +%-type objectid() :: {<<_:96>>}.
   % <<UnixTimeSecs:32/big, MachineId:24/big, ProcessId:16/big, Count:24/big>>
   
  --spec objectid (unixsecs(), <<_:40>>, integer()) -> objectid().
  +%-spec objectid (unixsecs(), <<_:40>>, integer()) -> objectid().
   objectid (UnixSecs, MachineAndProcId, Count) ->
   	{<<UnixSecs :32/big, MachineAndProcId :5/binary, Count :24/big>>}.
   
  --spec objectid_time (objectid()) -> unixtime().
  +%-spec objectid_time (objectid()) -> unixtime().
   % Time when object id was generated
   objectid_time ({<<UnixSecs:32/big, _:64>>}) -> secs_to_unixtime (UnixSecs).
  
positive.code: 		true -> Doc end end,
  	list_to_tuple (doc_foldr (Fun, [], Document)).
  
  -spec update (label(), value(), document()) -> document().
  % Replace field with new value, adding to end if new
  update (Label, Value, Document) -> case find (Label, Document) of
  	{Index} -> setelement (Index * 2 + 2, Document, Value);
  
negative.code: 		{} -> Doc end end,
  	list_to_tuple (lists:foldr (Fun, [], Labels)).
  
  %-spec exclude ([label()], document()) -> document().
  % Remove given fields from document
  exclude (Labels, Document) ->
  	Fun = fun (Label, Value, Doc) -> case lists:member (Label, Labels) of
  