functional programming in scala pdf