1. 5
  1.  

  2. 1

    That’s a pretty interesting way to describe dynamic programming. I would probably have wrapped this up somehow so that the caller isn’t having to carry around a reference to the cache (instead having a (function, cache) pair that knows how to operate on things properly), but the image of the function operating directly on the user’s array is fun.

    1. 1

      douglas-mcllroy’s paper ‘squinting at power series’ is pretty good, and uses haskell for elucidating these concepts. check it out !

      if you like that kind of thing, it is the kind of thing that you would like :)