Implement mapKeysWith and rewrite mapKeys.