view arrows/@arrf/arrf.m @ 27:5de03f77dae1

Added documentation about types and revised arrow type specifications.
author samer
date Sat, 19 Jan 2013 14:22:09 +0000
parents 672052bd81f8
children beb8a3f4a345
line wrap: on
line source
% arrf - Creat functional arrow using a function factory
%
% arrf :: 
%    FF: (SZ -> (A@typelist(N)->B@typelist(M))) ~'function to create function from sizes',
%    N: natural ~'number of inputs',
%    M: natural ~'number of outputs',
%    options {}
% -> arrow(A@typelist(N),B@typelist(M),empty).
%
% The type empty denotes the type of empty arrays, ie
% the state of an arr arrow is always an empty matrix.

function o=arrf(ffn,nin,nout,varargin)
	opts=prefs('sizefn',[],varargin{:});
	o=class(struct('fn',ffn,'sizefn',opts.sizefn),'arrf',arrow(nin,nout));
end