SCM Repository
[smlnj] / sml / trunk / benchmarks / todo / vboyer / vector-util.sml |
View of /sml/trunk/benchmarks/todo/vboyer/vector-util.sml
Parent Directory
|
Revision Log
Revision 193 -
(download)
(annotate)
Fri Nov 20 17:43:59 1998 UTC (22 years, 2 months ago) by monnier
File size: 473 byte(s)
Fri Nov 20 17:43:59 1998 UTC (22 years, 2 months ago) by monnier
File size: 473 byte(s)
Initial revision
structure VectorUtil = struct local open Vector in fun listOfVector v = let fun f (0, l) = l | f (i, l) = f (i-1, Vector.sub(v, i-1) :: l) in f (Vector.length v, []) end fun mapv f = let fun mapv' #[a] = #[f a] | mapv' #[a, b] = #[f a, f b] | mapv' #[a, b, c] = #[f a, f b, f c] | mapv' #[a, b, c, d] = #[f a, f b, f c, f d] | mapv' v = vector (map f (listOfVector v)) in mapv' end end end;
root@smlnj-gforge.cs.uchicago.edu | ViewVC Help |
Powered by ViewVC 1.0.0 |