add definition for When.map