Arrays are the only other mutable data structure after the ref type. They are similar to C arrays. Entries are indexed from 0. All index operations are range checked. The top level array type can contain entries of any type (as long as they are all the same type of course). In addition SML/NJ provides arrays specialised to a fixed entry type: CharArray, Word8Array and Real64Array. You could use CharArray as a text buffer or Word8Array as a byte buffer. These conform to the MONO_ARRAY signature.
If you want faster access without range checking then there are some unsafe versions of these structures in Unsafe.CharArray, Unsafe.Word8Array and Unsafe.Real64Array. See the section called The Unsafe API in Chapter 4.
The Array2 structure provides two-dimensional arrays.
Vector types are like arrays but they are immutable. The most useful forms of vectors are the monomorphic structures: CharVector, Word8Vector and Real64Vector. The CharVector.vector type is defined to be the same as the top-level string type so you can use its functions on strings. The Word8Vector.vector provides a byte string that is used for binary I/O in other parts of the Basis library.