Functional Programming in Sublinear Space