factor out a nice debug printing routine for types