> This makes some sense intuitively, but it would be good to see the details worked out.
The answer seems to be Safe Haskell: https://downloads.haskell.org/ghc/latest/docs/users_guide/ex...
(Source: Safe extension mentioned in https://github.com/ed-o-saurus/PLHaskell/blob/d917f0991a455c...)
The PGm monad seems to be an instance of §6.18.1.2. Building secure systems (restricted IO Monads): https://downloads.haskell.org/ghc/latest/docs/users_guide/ex...
> There is always `unsafePerformIO`, after all...
Forbidden in untrusted code by Safe Haskell.