use GHC api to get type of expression