{-# OPTIONS_GHC -Wunused-imports #-}
module Language.Haskell.LSP.Test.Compat where
-import Control.Concurrent.Chan
-import Control.Monad.IO.Class
-import Data.Conduit
import Data.Maybe
#if MIN_VERSION_process(1,6,3)
#if MIN_VERSION_process(1,6,3)
getProcessID' = System.Process.getPid
#else
+#if MIN_VERSION_process(1,6,0)
getProcessID' (ProcessHandle mh _ _) = do
+#else
+ getProcessID' (ProcessHandle mh _) = do
+#endif
p_ <- readMVar mh
case p_ of
#ifdef mingw32_HOST_OS
#endif
_ -> return Nothing
#endif
-
-#if MIN_VERSION_conduit(1,3,0)
-chanSource :: MonadIO m => Chan o -> ConduitT i o m b
-#else
-chanSource :: MonadIO m => Chan o -> ConduitM i o m b
-#endif
-chanSource c = do
- x <- liftIO $ readChan c
- yield x
- chanSource c