The essence of using Exponentiation by Squaring to calculate Fibonacci sequences in log(N) time is also covered in SICP exercise 1.19.
The elegance of the Haskell solution is that you only need to define a Monoid, and then you get exponentiation by squaring for free. This is a great example of abstraction done right.
The elegance of the Haskell solution is that you only need to define a Monoid, and then you get exponentiation by squaring for free. This is a great example of abstraction done right.