moduleDebian.Extra.CIO(tMessage,vMessage,printStdout,printStderr,printOutput,dotOutput)whereimportqualifiedData.ByteString.Char8asBimportExtra.CIOimportPreludehiding(putStr)importSystem.Unix.Process-- |Print a message without forcing the command's outputtMessage::CIOm=>String->a->matMessagemessageoutput=ePutStrBlmessage>>returnoutput-- |Print a message without forcing the command's outputvMessage::CIOm=>Int->String->a->mavMessagevmessageoutput=vEPutStrBlvmessage>>returnoutput-- |Print stdout to stdoutprintStdout::CIOm=>[Output]->m[Output]printStdoutoutput=bol>>mapMprintoutputwhereprintx@(Stdouts)=putStr(B.unpacks)>>returnxprintx=returnx-- |Print stderr to stderrprintStderr::CIOm=>[Output]->m[Output]printStderroutput=eBOL>>mapMprintoutputwhereprintx@(Stderrs)=ePutStr(B.unpacks)>>returnxprintx=returnx-- |Print all the output to the appropriate output channelprintOutput::CIOm=>[Output]->m[Output]printOutputoutput=eBOL>>mapMprintoutputwhereprintx@(Stdouts)=putStr(B.unpacks)>>returnxprintx@(Stderrs)=ePutStr(B.unpacks)>>returnxprintx=returnx-- |Print one dot to stderr for every COUNT characters of output.dotOutput::CIOm=>Int->[Output]->m[Output]dotOutputgroupSizeoutput=mapM(\(count,elem)->ePutStr(replicatecount'.')>>returnelem)pairswherepairs=zip(dots0(maplengthoutput))outputdots_[]=[]dotsrem(count:more)=let(count',rem')=divMod(count+rem)groupSizeincount':dotsrem'morelength(Stdouts)=B.lengthslength(Stderrs)=B.lengthslength_=0