{
  "$type": "site.standard.document",
  "bskyPostRef": {
    "cid": "bafyreigro4yeqvpkxjx4c7j4sjiorlg5fmfyzoewwynnrp3vgnzwhjtzim",
    "uri": "at://did:plc:pi6woz4d47bkuws673w2il2r/app.bsky.feed.post/3mpkzxlmyunh2"
  },
  "path": "/t/ghc-proposal-top-level-io-initialized-bindings/14328?page=2#post_21",
  "publishedAt": "2026-07-01T07:10:59.000Z",
  "site": "https://discourse.haskell.org",
  "tags": [
    "Motivation"
  ],
  "textContent": "Ambrose:\n\n> What’s wrong with the existing way to do it?\n\nDo the “sharp edges” mentioned under Motivation not answer that?\n\nMy immediate motivation for this thread is me wanting to use top-level `unsafePerformIO` + `NOINLINE` at work, and hearing concerns about “we’ve seen it inlined in the past, so we don’t trust it”. To me, there’s nothing inherently unsafe about top-level IO, the distrust only comes about because of GHC’s mysterious optimization rules. I’d prefer there was a semantic way to do this that could be relied upon as a language construct, and not just a magic incantation GHC may or may not respect.\n\nAmbrose:\n\n> I’m sorry but that i read a NOINLINE vs OPAQUE discourse thread and then see a ghc proposal about it is wild to me LOL\n\nha yeah, it is a bit amusing on the outside, but I’ve been mulling on this for years already. This was just a breaking point, I guess",
  "title": "GHC Proposal: Top-level IO initialized bindings"
}