A practical introduction to functional programming (2013)
The thing with functional languages is that most imperative languages can "do functional things", but not vice versa.<p>For example, many algorithms are beautiful when expressed in a recursive manner (Fibonacci, for example) , and pretty much all languages permit one to do recursion (even old fashioned C).<p>But many algorithms are much more elegant when expressed through for loops. For example, if one needs to iterate through lines keeping state into account, a<p>for (int i =0;i<len;i++){
  if(lines[i] == "a"){
    i+=2;
  }
}<p>seems much cleaner than an equivalently functional algorithm.<p>-----<p>EDIT.<p>I (purposefully) left out the "main" logic (as it's not really relevant to the post).<p>Of course in a "real" example, the code would look like: 
for (int i =0;i<len;i++){
  if(lines[i] == "a"){
    i+=2;
  } else{
    parseLine(lines[i]);
  }
}<p>The goal is to skip the line after a line starting with the letter "a".