| Copyright | (c) Habib Alamin 2017 |
|---|---|
| License | BSD-style (see the file libraries/base/LICENSE) |
| Maintainer | libraries@haskell.org |
| Stability | provisional |
| Portability | portable |
| Safe Haskell | Safe |
| Language | Haskell2010 |
System.Environment.Blank
Description
A setEnv implementation that allows blank environment variables. Mimics
the Env module from the unix package, but with support
for Windows too.
The matrix of platforms that:
- support putenv(FOO) to unset environment variables,
- support putenv("FOO=") to unset environment variables or set them to blank values,
- support unsetenv to unset environment variables,
- support setenv to set environment variables,
- etc.
is very complicated. I think AIX is screwed, but we don't support it. The whole situation with setenv(3), unsetenv(3), and putenv(3) is not good. Even mingw32 adds its own crap to the pile, but luckily, we can just use Windows' native environment functions to sidestep the issue.
#12494
Documentation
module System.Environment
Arguments
| :: String | variable name |
| -> String | fallback value |
| -> IO String | variable value or fallback value |
Get an environment value or a default value.