{
  "$type": "site.standard.document",
  "bskyPostRef": {
    "cid": "bafyreiedo5mswjloyjfe7c3kd673aicxzoclpylocoryyohyhucl6vxbe4",
    "uri": "at://did:plc:pi6woz4d47bkuws673w2il2r/app.bsky.feed.post/3mpmccgkeffl2"
  },
  "path": "/t/ghc-proposal-top-level-shared-io-computations/14328?page=2#post_24",
  "publishedAt": "2026-07-01T09:27:59.000Z",
  "site": "https://discourse.haskell.org",
  "textContent": "prophet:\n\n>\n>     blah_impl :: Blurg\n>     blah_impl = unsafePerformIO someEffectfulFunction\n>     {-# OPAQUE blah_impl #-}\n>\n>     blah :: IO Blurg\n>     blah =  pure blah_impl\n>\n\nI like that, but I would instead suggest:\n\n\n    data Box a = Box a\n\n    blah_impl :: Box Blurg\n    blah_impl = unsafePerformIO (Box <$> someEffectFulFunction)\n    {-# OPAQUE blah_impl #-}\n\n    blah :: IO Blurg\n    blah = let !(Box x) = blah_impl in pure x\n\n\nThat way the IO action will run whenever `blah` runs for the first time, not only later when the result of `blah` is forced. And this doesn’t force the `Blurg` itself.",
  "title": "GHC Proposal: Top-level shared IO computations"
}