add `getType' TH function that is used to generate a Type from a TH.Type
update some tests, using the getType function
use new getType functions in examples