The Rhetorical Device, Chiasmus means repetition of ideas in inverted order.
For example: “It is boring to eat; to sleep fulfilling.”
Chiasmus frequently uses the pattern above which is present participle-infinitive; infinitive-present participle.
Other examples:
“The instinct of a man is
to pursue everything that flies from him, and
to fly from all that pursues him.” (Voltaire)
“Bad men live that they may eat and drink,
whereas good men eat and drink that they may live.” – Socrates (5th Century B.C.)
“Fair is foul, and foul is fair” (Macbeth, I, i)
“Judge not, lest ye be judged”
John F. Kennedy’s famous “ask not what your country can do for you, ask what you can do for your country”
Information from Silva Rhetoricae: The Forest of Rhetoric and Literary Devices