{
"$type": "site.standard.document",
"bskyPostRef": {
"cid": "bafyreica2msewd7vn3nnm6p4fpnjm4doeuupfqgk6hulccm65nlfvprfsa",
"uri": "at://did:plc:pi6woz4d47bkuws673w2il2r/app.bsky.feed.post/3mlldaatvm4n2"
},
"path": "/t/conduit-to-yield-first-lines-from-file-without-leaking-space-or-file-handles/14030#post_16",
"publishedAt": "2026-05-11T11:44:21.000Z",
"site": "https://discourse.haskell.org",
"tags": [
"here",
"made a reply",
"Bluefin streams finalize promptly"
],
"textContent": "sjshuck:\n\n> The quick solution here is to sequester the file reading in its own `ResourceT`. See here.\n\nThanks for taking a look! That has the opposite problem for me: too early finalization. I have made a reply with an example.\n\nsjshuck:\n\n> It should say the finalization will be run as soon as the conduit is exited, either normally or via exception.\n\nUnfortunately I think not. In fact I don’t see any way to use `ResourceT` with `ConduitT` to achieve prompt finalization in the present of exceptions. That’s what I wrote about at Bluefin streams finalize promptly.",
"title": "Conduit to yield first lines from file without leaking space or file handles?"
}