All my joys to this are folly,
Naught so sweet as melancholy. (Robert Burton)
Or if thy mistress some rich anger shows,
Emprison her soft hand, and let her rave,
And feed deep, deep upon her peerless eyes. (John Keats)
If folly is the domination of reason by the passions, let us say that melancholy is the domination of passion by reason. The danger is that folly degenerates into mere stupidity, melancholy into cruelty. But if Erasmus was able to sing the praises of folly, Dowland was able to compose his melancholy into music. That is, Erasmus was able to argue that folly made love possible despite reason, Dowland was able to show that wisdom was possible in the face of great passion.
Something like that.
It is important to recognize folly as a kind of intelligent stupidity—unwise, to be sure, but not a denial of wisdom. Likewise, there is something loveless about melancholy but not a denial of love as such. There is always a kindness in its cruelty.
Finally, consider that folly thrives in seduction, and melancholy dwells in our contradictions. Folly leads us astray, melancholy speaks against us. Always for our own damned good.