The HI mass function of group galaxies in the ALFALFA survey