The wavefunction of an anyon