Several tales in the "One Thousand and One Nights" use the self-fulfilling prophecy, as a special form of literary prolepsis, to foreshadow what is going to happen. This literary device dates back to the story of Krishna in ancient Sanskrit literature, and Oedipus or the death of Heracles in the plays of Sophocles. A variation of this device is the self-fulfilling dream, which can be found in Arabic literature (or the dreams of Joseph and his conflicts with his brothers, in the Hebrew Bible).