Helper functions for dealing with array types

Fixes #82.