% horzcat - function combinator, 
%
% horzcat ::
%    F:(A{1:N} => B{1:M}),
%    G:(A{1:N} => C{1:L}),
%    N:natural,              ~'defaults to nargin(F)'
%    M:natural               ~'defaults to nargout(F)'
% -> (A{1:N} => B{1:M}, C{1:L}).
function h=horzcat(varargin)
	funs=varargin;
	nouts=cell2mat(map(@nargout,varargin));
	NN=sum(nouts); N=length(funs);
	fns = { @q1n; @qnn };
	h=fns{acount(nargin(funs{1}),1)};

	function varargout=q1n(x), 
		varargout=cell(1,NN);
		j=0; for i=1:N
			k=j+nouts(i);
			[varargout{j+1:k}]=funs{i}(x); 
			j=k;
		end
	end
	function varargout=qnn(varargin), 
		varargout=cell(1,NN);
		j=0; for i=1:N
			k=j+nouts(i);
			[varargout{j+1:k}]=funs{i}(varargin{:}); 
			j=k;
		end
	end
end
