Since there are intelligent people here who follow the topic of evolutionary psychology, I'd like to hear opinions about some research from 2009. Particularly if this idea seems reasonable or not, but possibly other opinions that people might have about it.
The idea is a variation on one that's somewhat popular here: that some conditions usually regarded as mental illnesses (Asperger's for example) are beneficial, even adaptive. But the condition in question now is depression. Briefly, the argument is that depression, at least when it is a response to stimuli and not a permanent feature, can have the useful effect of encouraging more rational thought when this is particularly important, even at the cost of quality of life, and that this is adaptive.
Links: a Scientific American article, a journal article (which I haven't read, behind a $12 paywall). Here's the abstract of the journal article:
Depression is the primary emotional condition for which help is sought. Depressed people often report persistent rumination, which involves analysis, and complex social problems in their lives. Analysis is often a useful approach for solving complex problems, but it requires slow, sustained processing, so disruption would interfere with problem solving. The analytical rumination hypothesis proposes that depression is an evolved response to complex problems, whose function is to minimize disruption and sustain analysis of those problems by (a) giving the triggering problem prioritized access to processing resources, (b) reducing the desire to engage in distracting activities (anhedonia), and (c) producing psychomotor changes that reduce exposure to distracting stimuli. As processing resources are limited, sustained analysis of the triggering problem reduces the ability to concentrate on other things. The hypothesis is supported by evidence from many levels—genes, neurotransmitters and their receptors, neurophysiology, neuroanatomy, neuroenergetics, pharmacology, cognition, behavior, and efficacy of treatments. In addition, the hypothesis provides explanations for puzzling findings in the depression literature, challenges the belief that serotonin transmission is low in depression, and has implications for treatment.
The full journal citation is Andrews, Paul W., and Thomson Jr., J. Anderson; July 2009; Psychological Review 116 (3), 620–654; doi 10.1037/a0016242.
There are many facets to depression and to analyse them from a evolutionary perspective, you should evaluate every single one them separately.
Some specific types of depression, like 'burn-out' syndrome, have an obvious cause-effect and is some sort of defense mechanism to protect you from yourself. The metaphor of getting burned is fitting, because it's similar to physical pain.
But evolution doesn't bother if something is beneficial or not. A common mutation can be devastating for the individuals mental health, but as a species we can have evolved to circumvent this weakness by triggering certain behaviors to prevent us from reproducing. The courting behavior in animals is also often a test the behavior of a potential partner; unexpected behavior leads to rejection.
Genes do not evolve into cleaner, more efficient code, but rather into super complex buggy spaghetti-code that somehow works. We may have evolved to be somewhat intelligent, but we are also inherently flawed.
An interesting observation in that regard was the deranged penguin (documentary: Encounters at the End of the World).
https://www.youtube.com/watch?v=x7kdDeGXUjI