module System.Process.Text.Builder 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 (toChunks)
import Data.Text.Lazy.Builder (Builder, fromText)
import Prelude hiding (null)
import System.Process
import System.Process.Common
import System.Exit (ExitCode)
instance ListLikeProcessIO Builder Char where
forceOutput = C.evaluate . force
readChunks h = (map fromText . toChunks) <$> hGetContents h
readProcessWithExitCode
:: FilePath
-> [String]
-> Builder
-> IO (ExitCode, Builder, Builder)
readProcessWithExitCode = System.Process.Common.readProcessWithExitCode
readCreateProcessWithExitCode
:: CreateProcess
-> Builder
-> IO (ExitCode, Builder, Builder)
readCreateProcessWithExitCode = System.Process.Common.readCreateProcessWithExitCode