functional programming in swift post