functorial version of SplayMap