anchor.diff:  %% @end
   %%-------------------------------------------------------------------
   
  --spec seal(Dom::domain(T)) -> domain(box(T)).
  +-spec seal(Dom::domain(T)) -> domrec(box(T)).
       
   seal(Dom) ->
       Seed = random:seed(),
  
positive.code: %%------------------------------------------------------------------------
  %% @doc Create custom domain.
  %% This function allows you to create a custom domain with it's own
  %% shrinking logic.  For instance, the natural numbers can be specified thus:
  %%
  %% <pre>nat() -> 
  %%    domain("Natural Numbers",
  %%      fun(Self,foo,Size) -> {NatDom,random:uniform(Size)} end,
  %%      fun(Self,foo,Value) when Value>0 ->
  %%            {Self, Value-1};
  %%         (Self,_,0) ->
  %%            {0, 0}
  %%      end,
  %%      foo).</pre>
  %%
  %% The domain itself (`Self' in the above code) is passed as the first argument
  %% to each invocation of both the picking and the shrinking functions.
  %%
  %% The `Data' argument (in this case `foo') is passed as the second argument 
  %% to each invocation of both the picking and shrinking functions.
  %%
  %% Both the picking and the shrinking function must return a 2-tuple of 
  %% the domain of the resulting value, and the value itself.
  %%
  %% @spec domain(Name::any(),
  %%	     PickFun :: user_pick_fun(D,T),
  %%	     ShrinkFun :: user_shrink_fun(D,T),
  %%	     Data::D) -> domain(T)
  %% @end
  %%------------------------------------------------------------------------
  
  -type user_pick_fun(D,T) :: fun ( (Self::domain(T),Data::D,Size::pos_integer()) -> {domain(T), T}).
  -type user_shrink_fun(D,T) :: fun ( (Self::domain(T),Data::D,Value::T) -> {domain(T), T}).
  
  -spec domain(Name::any(),
  	     PickFun::user_pick_fun(D, T),
  	     ShrinkFun::user_shrink_fun(D, T),
  	     Data::D) -> domain(T).
  
  domain(Name,PickFun,ShrinkFun,Data) ->
      #?DOM{kind=#custom{name=Name,pick=PickFun,shrink=ShrinkFun,data=Data},
  	  pick=fun domain_pick/2,
  	  shrink=fun domain_shrink/2}.
  
  domain_pick(#?DOM{kind=#custom{pick=PickFun,data=Data}}=Self, SampleSize) ->
      {_,_} = PickFun(Self, Data, SampleSize).
  
  domain_shrink(#?DOM{kind=#custom{shrink=ShrinkFun,data=Data}}=Self, Value) ->
      {_,_} = ShrinkFun(Self, Data, Value).
  
  
  %%
  
negative.code: %% using a generator
  -export([bind/2, suchthat/2, pick/2, shrink/2, sample/1, sampleshrink/1, 
  	 seal/1, open/1, peek/1,
  	 domain/3]).
  
  
  %%
  