For example: you may need to synchronize your circuit to the mains voltage, 50 or 60 Hz. If you connect one input to ground and another input through a large resistor and cliping diodes to the mains line, you can get a "1" logic level during the positive half wave and "0" during negative. For decoupling better to take the mains sine signal from a transformer secondary. But always remember that in area where to inputs' voltages are close to each other, the comparator will oscillate with a high frequency. So in the case of slow changing signals (like described above) one should add enough histeresys, using a positive feedback to the non-inverting input.