The STMatrix data type

np: a phantom type for the shape of the matrix. Most functions
will demand that this be specified as a pair. When writing a function
signature, you should always prefer STMatrix s (n,p) e to
STMatrix s np e.

e: the element type of the matrix. Only certain element types
are supported.

A safe way to create and work with a mutable matrix before returning
an immutable matrix for later perusal. This function avoids copying
the matrix before returning it - it uses unsafeFreezeMatrix internally,
but this wrapper is a safe interface to that function.