Neil spotted this while using MonadicSubtr in the Rain frontend -- -(MOSTNEG
INT) should fail, MINUS (MOSTNEG INT) shouldn't. This adds a MonadicMinus.
This was an "obvious" bug (a missing pattern) being masked by me doing a
pattern match inside an array constructor -- if the pattern doesn't match then
it'll skip that value, rather than causing an error like it does in a case.
This means that field names end up as "foo_u123" rather than "foo" in the
generated source -- which is a good thing, because some of the cgtests use
field names like "bool" and "int".
This fixes a bug that cgtest56 exposed, where an array of a user-defined type
that was itself an array wound up being an array of arrays rather than a single
array.
As part of this, makeArrayType is now called addDimensions, and takes a list of
dimensions to add rather than just one.
isValidLiteralType was a bit too simplistic before; it needs to look at array
types one dimension at a time rather than trying to do the whole lot at once.