forked from haskell/process
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathOsString.hs
More file actions
41 lines (36 loc) · 1.06 KB
/
OsString.hs
File metadata and controls
41 lines (36 loc) · 1.06 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
{-# LANGUAGE CPP #-}
{-# LANGUAGE PackageImports #-}
-- | Miscellaneous information about the system environment, for 'OsString'.
--
-- @since 1.6.26.0
module System.Process.Environment.OsString (
getArgs,
getEnv,
getEnvironment,
) where
import Data.Coerce (coerce)
#if MIN_VERSION_filepath(1, 5, 0)
import "os-string" System.OsString.Internal.Types (OsString(OsString))
#else
import "filepath" System.OsString.Internal.Types (OsString(OsString))
#endif
#if defined(mingw32_HOST_OS)
import qualified System.Win32.WindowsString.Console as Platform
#else
import qualified System.Posix.Env.PosixString as Platform
#endif
-- | 'System.Environment.getArgs' for 'OsString'.
--
-- @since 1.6.26.0
getArgs :: IO [OsString]
getArgs = coerce Platform.getArgs
-- | 'System.Environment.getEnv' for 'OsString'.
--
-- @since 1.6.26.0
getEnv :: OsString -> IO (Maybe OsString)
getEnv = coerce Platform.getEnv
-- | 'System.Environment.getEnvironment' for 'OsString'.
--
-- @since 1.6.26.0
getEnvironment :: IO [(OsString, OsString)]
getEnvironment = coerce Platform.getEnvironment