add generic map, flatMap, reverseMap