From 83d780015c4cd4cb3b7f1714cc5a8a7d40866374 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Gr=C3=B6ber?= Date: Sun, 31 Aug 2014 23:08:04 +0200 Subject: [PATCH] Use `readProcess'` in PkgDoc.hs --- Language/Haskell/GhcMod/PkgDoc.hs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Language/Haskell/GhcMod/PkgDoc.hs b/Language/Haskell/GhcMod/PkgDoc.hs index 3697c95..d981ddd 100644 --- a/Language/Haskell/GhcMod/PkgDoc.hs +++ b/Language/Haskell/GhcMod/PkgDoc.hs @@ -3,18 +3,19 @@ module Language.Haskell.GhcMod.PkgDoc (pkgDoc) where import Language.Haskell.GhcMod.Types import Language.Haskell.GhcMod.GhcPkg import Language.Haskell.GhcMod.Monad +import Language.Haskell.GhcMod.Utils import Control.Applicative ((<$>)) -import System.Process (readProcess) -- | Obtaining the package name and the doc path of a module. pkgDoc :: IOish m => String -> GhcModT m String -pkgDoc mdl = cradle >>= \c -> liftIO $ do - pkg <- trim <$> readProcess "ghc-pkg" (toModuleOpts c) [] +pkgDoc mdl = do + c <- cradle + pkg <- trim <$> readProcess' "ghc-pkg" (toModuleOpts c) if pkg == "" then return "\n" else do - htmlpath <- readProcess "ghc-pkg" (toDocDirOpts pkg c) [] + htmlpath <- readProcess' "ghc-pkg" (toDocDirOpts pkg c) let ret = pkg ++ " " ++ drop 14 htmlpath return ret where