Explain the functioning of corrective lenses used in eyeglasses. Discuss the different types of corrective lenses (such as convex and concave lenses) and how they correct various vision problems (like nearsightedness and farsightedness).