2 -- For some reason ghc warns about not using
3 -- Control.Monad.IO.Class but it's needed for
5 {-# OPTIONS_GHC -Wunused-imports #-}
6 module Language.Haskell.LSP.Test.Compat where
8 import Control.Concurrent.Chan
9 import Control.Monad.IO.Class
12 #ifdef mingw32_HOST_OS
14 import qualified System.Win32.Process as P (getCurrentProcessId)
15 getProcessID :: IO Int
16 getProcessID = fromIntegral <$> P.getCurrentProcessId
20 import qualified System.Posix.Process as P (getProcessID)
21 getProcessID :: IO Int
22 getProcessID = fromIntegral <$> P.getProcessID
26 #if MIN_VERSION_conduit(1,3,0)
27 chanSource :: MonadIO m => Chan o -> ConduitT i o m b
29 chanSource :: MonadIO m => Chan o -> ConduitM i o m b
32 x <- liftIO $ readChan c