Lessons from functional programming