HORIZON HASKELLDocslts/ghc-10.0.x8fef28d2026-11-02Search packagesCtrl K
Theme: |

GHC 10.0.0.20260917 · lts/ghc-10.0.x · 8fef28d · 2026-11-02

ModuleCabal-3.18.1.0Haskell2010

Distribution.Compat.Environment

Synopsis
  • PackageCabal-3.18.1.0
  • Exports4
  • LanguageHaskell2010
  • LicenceBSD-3-Clause
  • SourceEnvironment.hs
valuesetEnv :: String -> String -> IO ()

setEnv name value sets the specified environment variable to value.

valueunsetEnv :: String -> IO ()

unsetEnv name removes the specified environment variable from the environment of the current process.

Throws IOException if name is the empty string or contains an equals sign.

Beware that this function must not be executed concurrently with getEnv, lookupEnv, getEnvironment and such. One thread reading environment variables at the same time with another one modifying them can result in a segfault, see Setenv is not Thread Safe for discussion.