automatically figure out floattype and idtype.

This is still done quite ugly.