Remix.run Logo
whateveracct 5 days ago

Feels like an API that was backed by lazy cons lists like Haskell's would give you actual circular lists for free here.

Jaxan 5 days ago | parent [-]

It would still have a beginning. And it would not be “for free” as the used/seen part of the data structure would remain in memory.

whateveracct 5 days ago | parent [-]

The list in memory would not have duplicates (which this one seems to have) because the list itself would be cyclical.

It could be infinite in both directions. That's just a zipper or

    ([a], a, [a])