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

It basically works the same way the "self-referential" fib does, doesn't it?

    fibs = 0 : 1 : zipWith (+) fibs (tail fibs)


Not exactly: you don't get the O(1) access to the two previous computations with loeb. It abstracts the collection used for memoization, but it doesn't provides "locality".

Here's a presentation that dives into loeb and expands it to a comonadic fixpoint that lets you do the fibs example correctly: https://www.youtube.com/watch?v=F7F-BzOB670




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: