A Gentle Introduction to Functional Programming