Mercurial > hg > ishara
view arrows/emerge.m @ 2:7357e1dc2ad6
Simplified scheduler library with new schedule representation.
author | samer |
---|---|
date | Sat, 22 Dec 2012 16:17:51 +0000 |
parents | 672052bd81f8 |
children |
line wrap: on
line source
% emerge - Arrow to merge event inputs % % emerge :: N:natural ~'number of inputs' % -> arrow({[N]->boxed(A)},{boxed(A)},empty). % % Inputs are event streams, ie values of type boxed(A), % which are cell arrays of values of type A. % Output is an event stream consisting of all events % merged into one stream. If multiple events arrive % at one time, the output cell array will contain more % than one value. function o=emerge(nin) o=arr(@merge); function y=merge(varargin), y=cat(2,varargin{1:nin}); end end