Code for my demo of pure functional dynamic programming