{
  "$type": "site.standard.document",
  "bskyPostRef": {
    "cid": "bafyreibt3qd4z5ih4k3aecpmzbf57lll5p22jh2vkzwciycyyvy37kf7cm",
    "uri": "at://did:plc:pi6woz4d47bkuws673w2il2r/app.bsky.feed.post/3mngux52dfvf2"
  },
  "path": "/t/h2jvm-a-haskell-library-for-writing-jvm-bytecode/14182#post_7",
  "publishedAt": "2026-06-04T04:51:08.000Z",
  "site": "https://discourse.haskell.org",
  "textContent": "Sure; `DList` can do more, but for the common case of just needing to accumulate a list in the opposite order of the desired order of the result, it seems like overkill (both in terms of intelligibility and allocation).\n\nI feel like people get the impression that using function composition is somehow leading to some aspect having zero overhead, but it isn’t. And in particular, the final `toList` is O(n), just like reversing a list. Either way you do it, it will have at least double the execution cost of just accumulating a list in the “wrong” order.\n\nGenerally with Chuch-encoding-like constructions, I think it’s cool that you can do it but that doesn’t mean you should; it’s slick but maybe not the best implementation.",
  "title": "H2JVM - A Haskell Library for writing JVM Bytecode"
}