% with_field - Apply operator to structure
% with_field :: 
%     N:string ~'field name',
%     (A->B)   ~'function'
% -> (struct { N : A } -> struct { N : B}).
function g=with_field(nm,f)
	g=@op;
	function x=op(x), x.(nm)=f(x.(nm)); end
end
