% scancols :; 
%    ([[M]], [[N]] -> [[M]])   ~'scannning function',
%    [[M]]                     ~'initial value',
%    [[N,L]]                   ~'data to scan, sequence of length L'
% -> [[M,L]].

function Y=scancols(f,y,X)
	Y=zeros(size(y,1),size(X,2));
	for i=1:size(X,2), y=f(y,X(:,i)); Y(:,i)=y; end
end
		

