kotlin reduce to different type