A function-based typology for Earth’s ecosystems