annotate 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 |
rev |
line source |
samer@0
|
1 % arrf - Creat functional arrow using a function factory
|
samer@0
|
2 %
|
samer@0
|
3 % arrf ::
|
samer@27
|
4 % FF: (SZ -> (A@typelist(N)->B@typelist(M))) ~'function to create function from sizes',
|
samer@0
|
5 % N: natural ~'number of inputs',
|
samer@0
|
6 % M: natural ~'number of outputs',
|
samer@0
|
7 % options {}
|
samer@27
|
8 % -> arrow(A@typelist(N),B@typelist(M),empty).
|
samer@0
|
9 %
|
samer@0
|
10 % The type empty denotes the type of empty arrays, ie
|
samer@0
|
11 % the state of an arr arrow is always an empty matrix.
|
samer@0
|
12
|
samer@0
|
13 function o=arrf(ffn,nin,nout,varargin)
|
samer@0
|
14 opts=prefs('sizefn',[],varargin{:});
|
samer@0
|
15 o=class(struct('fn',ffn,'sizefn',opts.sizefn),'arrf',arrow(nin,nout));
|
samer@0
|
16 end
|