Fyodor Dostoyevsky said this quote

A dream is a strange thing. Pictures appear with terrifying clarity, the minutest details engraved like pieces of jewelry, and yet we leap unawares through huge abysses of time and space. Dreams seem to be controlled by wish rather than reason, the heart rather than the head–and yet, what clever, tricky convolutions my reason sometimes makes while I’m asleep! Things quite beyond comprehension happen to reason in dreams!