anchor.diff:        Tail
      ).
   
  +%%
  +%% terminate pipeline
  +-spec(free/1 :: ([proc()]) -> ok).
  +
  +free(Pipeline) ->
  +   lists:foreach(
  +      fun
  +      ({Pid, Ref}) ->
  +         _ = erlang:demonitor(Ref, [flush]),
  +         erlang:send(Pid, {'$pipe', self(), '$free'});
  +      (Pid) -> 
  +         erlang:send(Pid, {'$pipe', self(), '$free'}) 
  +      end,
  +      Pipeline
  +   ).
  +
   
   %%
   %% send message through pipe
  
positive.code:    {'$pipe', '$b', Pid} ->
        ?DEBUG("pipe ~p: bind a to ~p", [self(), Pid]),
        pipe_loop(Fun, A, Pid);
     {'$pipe', B, Msg} ->
        _ = pipe:send(A, Fun(Msg)),
        pipe_loop(Fun, A, B);
  
negative.code: 
  %%
  %% spawn stateless pipe handler
  -spec(spawn/1         :: (function()) -> pid()).
  -spec(spawn_link/1    :: (function()) -> pid()).
  -spec(spawn_monitor/1 :: (function()) -> {pid(), reference()}).
  
  spawn(Fun) ->
     erlang:spawn(fun() -> pipe_loop(Fun, undefined, undefined) end).
  
  spawn_link(Fun) ->
     erlang:spawn_link(fun() -> pipe_loop(Fun, undefined, undefined) end).
  
  spawn_monitor(Fun) ->
     erlang:spawn_monitor(fun() -> pipe_loop(Fun, undefined, undefined) end).
  
  %%
  %% bind process to pipeline
  