forkLambdabot :: IO (Maybe (Handle,Handle,Handle,ProcessHandle))
forkLambdabot = withLambdabot $ do
    b <- doesFileExist "./lambdabot"
    home  <- readIORef lambdabotHome
    args' <- readIORef lambdabotFlags
    let args | null args' = []
             | otherwise  = [args']
    if not b
        then do putStrLn $ "No lambdabot binary found in: " ++ home
                return Nothing
        else E.catch
                (do x <- runInteractiveProcess "./lambdabot" args Nothing Nothing
                    return (Just x))
                (\(e :: E.IOException) -> do
                    putStrLn $ "Unable to start lambdabot: " ++ show e
                    return Nothing)

-- |
-- Query lambdabot
--
forkLambdabot :: IO (Maybe (Handle,Handle,Handle,ProcessHandle))
forkLambdabot = withLambdabot $ do
    b <- doesFileExist "./lambdabot"
    home  <- readIORef lambdabotHome
    args' <- readIORef lambdabotFlags
    let args | null args' = []
             | otherwise  = [args']
    if not b
        then do putStrLn $ "No lambdabot binary found in: " ++ home
                return Nothing
        else E.catch
                (do x <- runInteractiveProcess "./lambdabot" args Nothing Nothing
                    return (Just x))
                (\(e :: E.IOException) -> do
                    putStrLn $ "Unable to start lambdabot: " ++ show e
                    return Nothing)

-- |
-- Query lambdabot
--
forkLambdabot = withLambdabot $ do
    b <- doesFileExist "./lambdabot"
    home  <- readIORef lambdabotHome
    args' <- readIORef lambdabotFlags
    let args | null args' = []
             | otherwise  = [args']
    if not b
        then do putStrLn $ "No lambdabot binary found in: " ++ home
                return Nothing
        else E.catch
                (do x <- runInteractiveProcess "./lambdabot" args Nothing Nothing
                    return (Just x))
                (\(e :: E.IOException) -> do
                    putStrLn $ "Unable to start lambdabot: " ++ show e
                    return Nothing)

-- |
-- Query lambdabot
--