anchor.diff:  %% API
   -export([pushl/2, pushr/2, is_empty/1, headl/1, taill/1, concat/2, measure/2]).
   
  -%%
  -%% Monoid behavior
  -%%
  -%%-callback identity(T) -> T.
  -%%-callback binary_op(T,T) -> T.
   
   -define(SUSP(Expr), fun() -> Expr end).
   -define(FORCE(Expr),Expr()).
  +
  +-define(MOD,finger_tree_monoid@).
   
   -type tree_node(E) ::
   {node2,E,E}
  
positive.code: 
  %%
  %% This might work much better with Elixir protocols, because we can define the Monoid {Id,As} using a protocol
  %%
  
  node2(A,B,Mo = {_,As,_}) ->
      V = measure(A,Mo),
      V1 = measure(B,Mo),
      {node2,As(V,V1),A,B}.
  
  node3(A,B,C,Mo = {_,As,_})  ->
      V = measure(A,Mo),
      V1 = measure(B,Mo),
      V2 = measure(C,Mo),
      V3 = As(As(V,V1),V2),
      {node3,V3,A,B,C}.
  
  deep(PR,M,SF,Mo = {_,As,_}) ->
      V = measure(PR,Mo),
      V1 = measure(M,Mo),
      V2 = measure(SF,Mo),
      V3 = As(As(V,V1),V2),
      {deep,V3,PR,M,SF}.
  
  measure({node2,V,_,_},_Mo)          -> V;
  measure({node3,V,_,_,_},_Mo)        -> V;
  measure(D,{Id,As,M}) when is_list(D)-> reducel(fun(Z,E) -> As(Z,M(E)) end,Id,D);
  measure(empty,{Id,_,_})             -> Id;
  measure({single,X},Mo)              -> measure(X,Mo);
  measure({deep,V,_,_,_},_Mo)         -> V;
  measure(X,{_,_,M})                  -> M(X).
  
  
negative.code: -spec to_tree([E]) -> finger_tree(E).
  -spec to_list(finger_tree(E)) -> [E].
  to_tree(L) when is_list(L) -> lists:foldl(fun pushr/2,empty,L).
  to_list(T) -> reducer(fun(H,XS) -> [H|XS] end,T,[]).
  
  
  %%
  