{
"$type": "site.standard.document",
"bskyPostRef": {
"cid": "bafyreialzizjmcvs3khcqiban6tjs3rgkceu27i3fcht562p3geskugd4e",
"uri": "at://did:plc:pi6woz4d47bkuws673w2il2r/app.bsky.feed.post/3mkutatidvlc2"
},
"path": "/t/conduit-to-yield-first-lines-from-file-without-leaking-space-or-file-handles/14030#post_5",
"publishedAt": "2026-05-02T13:55:03.000Z",
"site": "https://discourse.haskell.org",
"tags": [
"streamly",
"jet-stream",
"streaming",
"streaming-bracketed",
"help"
],
"textContent": "This is a place where continuation-based streaming libraries (like streamly or my own toy library jet-stream) are a bit more ergonomic than pull-based libraries like conduit or streaming. Because they control the continuation, it’s easier for them to manage allocation/deallocation of resources, even with functions like `take`.\n\nI wrote a helper wrapper over streaming called streaming-bracketed to help with this same issue. From the package description:\n\n> Given a list [(Filepath,Int,Int)] of files and line ranges, create a stream\n> of lines belonging to the concatenated ranges.\n> Prompt release of file handles is required.",
"title": "Conduit to yield first lines from file without leaking space or file handles?"
}