typed swap