module System.Process.Chars where
#if !MIN_VERSION_base(4,8,0)
import Control.Applicative ((<$>))
#endif
import Control.DeepSeq (force)
import qualified Control.Exception as C (evaluate)
import Data.ListLike.IO (hGetContents)
import Data.Text.Lazy (fromStrict, toChunks)
import Data.ListLike.Chars (Chars(..))
import Prelude hiding (null)
import System.Process
import System.Process.Common
import System.Exit (ExitCode)
instance ListLikeProcessIO Chars Char where
forceOutput = C.evaluate . force
readChunks h = (map (T . fromStrict) . toChunks) <$> hGetContents h
readProcessWithExitCode
:: FilePath
-> [String]
-> Chars
-> IO (ExitCode, Chars, Chars)
readProcessWithExitCode = System.Process.Common.readProcessWithExitCode
readCreateProcessWithExitCode
:: CreateProcess
-> Chars
-> IO (ExitCode, Chars, Chars)
readCreateProcessWithExitCode = System.Process.Common.readCreateProcessWithExitCode