Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

This is certainly neat. This isn't a criticism, but I think more like an expansion on the author's point:

The reason this all works is that generators plus memoization is "just" an implementation of the lazy sequences that Haskell has built in.



Isn’t the original python without the recursion lazy as well? I that was the entire point of generators.


You're right, fair enough. This isn't only about generators, it's also about how they interact with recursion and memoization.




Consider applying for YC's Fall 2026 batch! Applications are open till July 27.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: