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