On a generalization of the Haar system