What was the function of medieval monasteries?

Monks lived in medieval monasteries. They spent their time in prayer, study and manual labour like farming. They also encouraged and developed art. In this way, medieval monasteries were the centers of religious and cultural activities. People in the monasteries led a simple life, inspired people to donate and to serve the sick. They valued human attributes and preach the same.