Type Inference for Sublinear Space Functional Programming