This is a nice summary of a great work by Michel Foucault, something very close to my own thinking.
from the Internet Encyclopedia of Philosophy:
“The History of Madness… much of the work is concerned with the birth of medical psychiatry, which Foucault associates with extraordinary changes in the treatment of the mad in modernity, meaning first their systematic exclusion from society in early modernity, followed by their pathologization
in late modernity.. with Foucault ultimately finding that madness is negatively constitutive of Enlightenment reason via its exclusion. The exclusion of unreason itself, concomitant with the physical exclusion of the mad, is effectively the dark side of the valorization of reason in modernity… Foucault argues in effect for the recuperation of madness, via a valorization of philosophers and artists deemed mad, such as Nietzsche, a recuperation which Foucault thinks the works of such men already portend.”