A Type Inference System for FP Programs