Haskell has a “safe” language dialect which prevents `unsafePerformIO` and others: https://downloads.haskell.org/~ghc/7.8.3/docs/html/users_gui... / https://simonmar.github.io/bib/papers/safe-haskell.pdf
However, I doubt Safe Haskell (without extensions) is formally verified, and it still uses GHC’s runtime, which could have RCEs. Also note that it doesn’t prevent infinite loops or memory exhaustion, the latter even during compilation.