A literary work is didactic if it teaches.
A didactic literary work is one that has the primary purpose of teaching or instructing the reader. Such works often have a moral or ethical message that the author wants to convey, and they use various literary devices such as allegory, metaphor, and symbolism to illustrate this message. Didactic works can be found in various forms of literature, including poetry, drama, and prose. While a literary work can also entertain, comfort, or criticize, if its primary aim is to teach, it is considered didactic.