Operations on arrays

Richard A. O'Keefe ok@atlas.otago.ac.nz
Fri, 5 Mar 1999 14:34:00 +1300 (NZDT)


I note with some surprise that
   base % (from, to)
   is defined for strings ({#Char}) and lists,
   but NOT for arrays in general

   left +++ right
   is defined for strings ({#Char})
   but NOT for arrays in general

In fact, since +++ isn't defined for anything but strings, it's a bit
of a puzzle why it's in StdOverloaded.

The snag is that I happen to need these operations on arrays of numbers.
I suppose I can do

   vappend xs ys = createArray (nxs+nys) (\i ->
                      if (i >= nxs) ys.[i-nxs] xs.[i])
                   where nxs = size xs; nys = size ys

   vslice xs f t = {xs.[i] \\ i <- [f..t]}

but these are obvious things to look for in StdArray.