Looks good although I think we can do without isNotArray(). Having isArray() is helpful because it's not obvious how to do it but since there is nothing more to the negation than not(isArray()), then let's keep it out.