I remember doing one of the Project Euler's problems, something in the vein of "you are given a 20x20 matrix, find an element for which the sum of the elements around it is maximum". Nothing complicated, right? You just iterate over rows, then over columns, then throw in a check for zero index and the max boundary index, then do this for both x and y, etc. When I was done with the problem (nested for loops, five if checks inside), I found someone else's solution in Haskell on Project Euler's forums. A point-free one-liner with bunch of smart folds.
That's the power of abstraction.