Commit b39e340b authored by tibbe's avatar tibbe
Browse files

Clean up import and export lists

Imports are now sorted alphabetically and shared imports come before
compiler/OS specific ones.

Import lists now use consistent indentation.

Nested CPP if statements are now indented so it's possible to match up
the ifs with the ends.
parent 5fe18cb9
......@@ -35,73 +35,74 @@
-}
module System.Process (
-- * Running sub-processes
createProcess,
shell, proc,
CreateProcess(..),
CmdSpec(..),
StdStream(..),
ProcessHandle,
-- ** Simpler functions for common tasks
callProcess,
callCommand,
spawnProcess,
spawnCommand,
readProcess,
readProcessWithExitCode,
-- ** Related utilities
showCommandForUser,
-- ** Control-C handling on Unix
-- $ctlc-handling
-- * Process completion
waitForProcess,
getProcessExitCode,
terminateProcess,
interruptProcessGroupOf,
-- * Old deprecated functions
-- | These functions pre-date 'createProcess' which is much more
-- flexible.
runProcess,
runCommand,
runInteractiveProcess,
runInteractiveCommand,
system,
rawSystem,
) where
-- * Running sub-processes
createProcess,
shell, proc,
CreateProcess(..),
CmdSpec(..),
StdStream(..),
ProcessHandle,
-- ** Simpler functions for common tasks
callProcess,
callCommand,
spawnProcess,
spawnCommand,
readProcess,
readProcessWithExitCode,
-- ** Related utilities
showCommandForUser,
-- ** Control-C handling on Unix
-- $ctlc-handling
-- * Process completion
waitForProcess,
getProcessExitCode,
terminateProcess,
interruptProcessGroupOf,
-- * Old deprecated functions
-- | These functions pre-date 'createProcess' which is much more
-- flexible.
runProcess,
runCommand,
runInteractiveProcess,
runInteractiveCommand,
system,
rawSystem,
) where
import Prelude hiding (mapM)
import System.Process.Internals
import Control.Exception (SomeException, mask, try, throwIO)
import Control.Concurrent
import Control.DeepSeq (rnf)
import System.IO.Error (mkIOError, ioeSetErrorString)
#if !defined(mingw32_HOST_OS)
import System.Posix.Types
import System.Posix.Process (getProcessGroupIDOf)
#endif
import Control.Exception (SomeException, mask, try, throwIO)
import qualified Control.Exception as C
import Control.Concurrent
import Control.Monad
import Data.Maybe
import Foreign
import Foreign.C
import System.IO
import Data.Maybe
import System.Exit ( ExitCode(..) )
import System.IO
import System.IO.Error (mkIOError, ioeSetErrorString)
#if !defined(mingw32_HOST_OS)
import System.Posix.Process (getProcessGroupIDOf)
import System.Posix.Types
#endif
#ifdef __GLASGOW_HASKELL__
import GHC.IO.Exception ( ioException, IOErrorType(..), IOException(..) )
#if defined(mingw32_HOST_OS)
import System.Win32.Process (getProcessId)
# if defined(mingw32_HOST_OS)
import System.Win32.Console (generateConsoleCtrlEvent, cTRL_BREAK_EVENT)
#else
import System.Win32.Process (getProcessId)
# else
import System.Posix.Signals
#endif
# endif
#endif
-- ----------------------------------------------------------------------------
......
......@@ -20,33 +20,25 @@
-----------------------------------------------------------------------------
module System.Process.Internals (
ProcessHandle(..), ProcessHandle__(..),
PHANDLE, closePHANDLE, mkProcessHandle,
modifyProcessHandle, withProcessHandle,
ProcessHandle(..), ProcessHandle__(..),
PHANDLE, closePHANDLE, mkProcessHandle,
modifyProcessHandle, withProcessHandle,
#ifdef __GLASGOW_HASKELL__
CreateProcess(..),
CmdSpec(..), StdStream(..),
createProcess_,
runGenProcess_, --deprecated
CreateProcess(..),
CmdSpec(..), StdStream(..),
createProcess_,
runGenProcess_, --deprecated
#endif
startDelegateControlC,
endDelegateControlC,
startDelegateControlC,
endDelegateControlC,
#if !defined(mingw32_HOST_OS) && !defined(__MINGW32__)
pPrPr_disableITimers, c_execvpe,
ignoreSignal, defaultSignal,
#endif
withFilePathException, withCEnvironment,
translate,
fdToHandle,
) where
#if !defined(mingw32_HOST_OS) && !defined(__MINGW32__)
import Control.Monad
import Data.Char
import System.Posix.Types
import System.Posix.Process.Internals ( pPrPr_disableITimers, c_execvpe )
import System.IO
pPrPr_disableITimers, c_execvpe,
ignoreSignal, defaultSignal,
#endif
withFilePathException, withCEnvironment,
translate,
fdToHandle,
) where
import Control.Concurrent
import Control.Exception
......@@ -57,6 +49,14 @@ import Foreign.Ptr
import Foreign.Storable
import System.IO.Unsafe
#if !defined(mingw32_HOST_OS) && !defined(__MINGW32__)
import Control.Monad
import Data.Char
import System.IO
import System.Posix.Process.Internals ( pPrPr_disableITimers, c_execvpe )
import System.Posix.Types
#endif
#ifdef __GLASGOW_HASKELL__
import System.Posix.Internals
import GHC.IO.Exception
......@@ -68,12 +68,12 @@ import GHC.IO.Handle.Internals
import GHC.IO.Handle.Types hiding (ClosedHandle)
import System.IO.Error
import Data.Typeable
#if defined(mingw32_HOST_OS)
# if defined(mingw32_HOST_OS)
import GHC.IO.IOMode
import System.Win32.DebugApi (PHANDLE)
#else
# else
import System.Posix.Signals as Sig
#endif
# endif
#endif
#if defined(mingw32_HOST_OS)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment