title: Functional programming and closures / partial application
body: <p>I'm confused about the nature of functional programming. It is mentioned <strong>higher order functions</strong> is one of the key concepts, which enables closures and techniques like partial application, i.e. capturing a <strong>state</strong> or a <strong>strategy</strong> alongside with a function to be returned. </p>
  
  <p>Yet, another key concepts are <strong>pure functions</strong> and <strong>immutable state</strong>. In other words functions wouldn't have side effects or read an external state. They should always return a same result with same parameters.</p>
  
  <p>This seems contradictory with the concept of <strong>higher order function</strong>, where a function indeed has an access to the state encapsulated by a closure. Of course this doesn't mean function has to mutate the state, but at least the state affects it's behavior.</p>
  
  <p>In other words, same function <em>may</em> return different result at subsequent executions of program. Or have I misunderstood, what <em>the same</em> means as a concept? What I think of is a function of a same name and a body, closure or not. After all, we are talking about mathematical like functions, not a methods of an unique entities. Should I regard functions returned by a higher order function as a different functions, not just referential, but as a definition?</p>