HORIZON HASKELLDocslts/ghc-9.10.xc74966e2026-09-27Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · c74966e · 2026-09-27

Moduleunix-2.8.7.0Haskell2010

System.Posix.Env.ByteString

POSIX environment support

  • 10 values
  • Packageunix-2.8.7.0
  • Exports10
  • LanguageHaskell2010
  • LicenceBSD-3-Clause
  • SourceByteString.hsc

Environment Variables

9 declarations
valueputEnv
  1. :: ByteString

    "key=value"

  2. -> IO ()
#

putEnv function takes an argument of the form name=value and is equivalent to setEnv(key,value,True{-overwrite-}).

valuesetEnv
  1. :: ByteString

    variable name

  2. -> ByteString

    variable value

  3. -> Bool

    overwrite

  4. -> IO ()
#

The setEnv function inserts or resets the environment variable name in the current environment list. If the variable name does not exist in the list, it is inserted with the given value. If the variable does exist, the argument overwrite is tested; if overwrite is False, the variable is not reset, otherwise it is reset to the given value.

valueclearEnv :: IO ()
#

The clearEnv function clears the environment of all name-value pairs.

Program arguments

1 declaration
valuegetArgs :: IO [ByteString]
#

Computation getArgs returns a list of the program's command line arguments (not including the program name), as ByteStrings.

Unlike getArgs, this function does no Unicode decoding of the arguments; you get the exact bytes that were passed to the program by the OS. To interpret the arguments as text, some Unicode decoding should be applied.