Memoize instances of IntegerType and FloatingPointType.