module System.Process.Strict where
import Control.DeepSeq (force)
import Data.ByteString.Char8 as B (ByteString)
import Data.ListLike.IO (hGetContents)
import Data.Text as T (Text)
import Data.Word (Word8)
import System.IO (hSetBinaryMode)
import System.Process.ListLike (ListLikePlus(..))
instance ListLikePlus B.ByteString Word8 where
setModes _ (inh, outh, errh, _) = f inh >> f outh >> f errh where f mh = maybe (return ()) (\ h -> hSetBinaryMode h True) mh
readChunks h = hGetContents h >>= return . force . (: [])
instance ListLikePlus T.Text Char where
setModes _ _ = return ()
readChunks h = hGetContents h >>= return . force . (: [])