“History, Stephen said, is a nightmare from which I am trying to awake.”
James Joyce wrote this in Ulysses. It appears in Nestor.
Where it appears
―What do you mean? Mr Deasy asked. He came forward a pace and stood by the table. His underjaw fell sideways open uncertainly. Is this old wisdom? He waits to hear from me. ― History, Stephen said, is a nightmare from which I am trying to awake. From the playfield the boys raised a shout. A whirring whistle: goal. What if that nightmare gave you a back kick? ―The ways of the Creator are not our ways, Mr Deasy said. All history moves towards one great goal, the manifestation of God.
From the public-domain edition, read it free.