{
  "$type": "site.standard.document",
  "bskyPostRef": {
    "cid": "bafyreihnne75q5wwgf55d7i2n5pdi432qkvblpwdbcr3nhrdso3jqgsh3q",
    "uri": "at://did:plc:pi6woz4d47bkuws673w2il2r/app.bsky.feed.post/3mm7ncwwwrhf2"
  },
  "path": "/t/lazily-consuming-a-self-referential-linked-list/14131#post_8",
  "publishedAt": "2026-05-19T14:15:05.000Z",
  "site": "https://discourse.haskell.org",
  "textContent": "L0neGamer:\n\n> What you’re trying to do here is produce a potentially infinite list as well as consume it in its entirety, and I think that that has issues.\n\nYou’re right, if worded that way it does sound quite impossible.\n\nL0neGamer:\n\n> I spent some time trying to use lazy writer and Endo to get some “efficient” concatenation but kept running up against looping code and end of list evaluations. I’d be interested in a solution if someone finds one!\n\nI don’t think I have a solution. I’m in a position where I can control/count the additions to the list and keep that as a balance. As soon as the balance reaches zero I stop evaluating (end-of-list divergence), more of a workaround than a solution, really.",
  "title": "Lazily consuming a self-referential linked list"
}