functional programming from charming python