executeProcess
    :: FilePath                 -- ^ command to run
    -> [String]                 -- ^ any arguments
    -> String                   -- ^ standard input
    -> IO (ExitCode, String, String) -- ^ exitcode, stdout, stderr
executeProcess cmd args input = do
  mp <- findExecutable cmd
  case mp of
    Nothing -> return (ExitFailure 127, "", "command not found: " ++ cmd)
    Just exe -> readProcessWithExitCode exe args input

-- | runs a command with timeout
executeProcess
    :: FilePath                 -- ^ command to run
    -> [String]                 -- ^ any arguments
    -> String                   -- ^ standard input
    -> IO (ExitCode, String, String)
executeProcess cmd args input = do
  mp <- findExecutable cmd
  case mp of
    Nothing -> return (ExitFailure 127, "", "command not found: " ++ cmd)
    Just exe -> readProcessWithExitCode exe args input

-- | runs a command with timeout
executeProcess cmd args input = do
  mp <- findExecutable cmd
  case mp of
    Nothing -> return (ExitFailure 127, "", "command not found: " ++ cmd)
    Just exe -> readProcessWithExitCode exe args input

-- | runs a command with timeout