Discovery of white dwarf pulsar sheds light on stellar evolution