In this book (a 1964 abridged edition of a book published in 1961) Michel Foucault:
“… examines the archaeology of madness in the West from 1500 to 1800 – from the late Middle Ages, when insanity was still considered part of everyday life and fools and lunatics walked the streets freely, to the time when such people began to be considered a threat, asylums were first built, and walls were erected between the ‘insane’ and the rest of humanity.”
Wikipedia describe the book as “an examination of the evolving meaning of madness in European culture, law, politics, philosophy and medicine from the Middle Ages to the end of the eighteenth century.”
You can find out more from here.