function [h,t]=split(dim,n,s)
% split - gather first n elements and return with rest of sequence
%
% split :: D:natural, N:natural, seq A -> [[N]->A], seq A

h=[];
for i=1:n, x=head(s); h=cat(dim,h,x); s=next(s); end
t=s;

	

