When a mocker is punished, the simple gain wisdom; by paying attention to the wise they get knowledge. (NIV)
When the scoffer is punished, the fool gets a lesson in being wise; but men of [godly] Wisdom and good sense learn by being instructed. (AMP)
When the scorner is punished, the simple is made wise: and when the wise is instructed, he receiveth knowledge. (KJV)