h$;5      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~                                           Safe-Inferred   highlight/Find the corresponding color for the number in , taking the mod of the .colorForFileNumber 0"\ESC[1m\ESC[94m"colorForFileNumber 1"\ESC[1m\ESC[92m"colorForFileNumber 4"\ESC[1m\ESC[94m" highlight turned into an  for faster lookup. highlight of . highlightList of all the colors that are used for highlighting filenames.$ highlightChange the intensity to .% highlight" the console color back to normal.& highlight Empty string.' highlightHelper for creating a / for an ANSI escape sequence color based on a  and a .( highlightConvert a list of  to a .)  !"#$%&'()  !"#$%&'(None 09 + highlight-A set of options that are common to both the  highlight and hrep applications.3 highlight8An input file passed in on the command line by the user.8 highlightThe raw, pre-compiled regular expression passed in on the command line by the user.= highlightWhether or not files should be searched recursively. Similar to grep's  --recursive option.B highlightWhether or not the case of a regular expression should be ignored. Similar to grep's  --ignore-case option.J highlightA default set of +. Defined as the following::{ let opts = CommonOptions3 { commonOptionsIgnoreCase = DoNotIgnoreCase/ , commonOptionsRecursive = NotRecursive> , commonOptionsRawRegex = RawRegex { unRawRegex = "" }* , commonOptionsInputFilenames = [] }:}opts == defaultCommonOptionsTrue")*+,0/.-123456789:;<=?>@ABDCEFGHIJ"BDC@AE=?>;@ABCDIJabcdefghijklmn%ijklghcdefnmab)*+123456789;<=>@ABCDIJNone| highlight Convert a  to a + with the encoding for the current locale.$convertStringToRawByteString "hello""hello"} highlightOpen a  in .On success, return a  :"openFilePathForReading "README.md"Right {handle: README.md}On error, return a  :,openFilePathForReading "thisfiledoesntexist">= (()  . f)This is used because  is not available in the tranformers-0.3.0.0 package. highlight exit code highlight!error message to print to console|}~|}~None highlightRead input from a <, split it into lines, and return each of those lines as a  in a Producer.This function will close the  if the end of the file is reached. However, if an error was thrown while reading input from the , the  is not closed.Setup for examples:import Pipes.Prelude (toListM)3import System.IO (IOMode(ReadMode), openBinaryFile)1let goodFilePath = "test/golden/test-files/file2" Examples:.handle <- openBinaryFile goodFilePath ReadMode,fmap head . toListM $ fromHandleLines handle"Proud Pour is a wine company that funds solutions to local environmental" highlightCall  on . highlight Try calling  on the  obtained from }.Setup for examples:import Pipes (Producer)import Pipes.Prelude (toListM)let t a = a :: IO (Either IOException (Producer ByteString IO ()))1let goodFilePath = "test/golden/test-files/file2"(let badFilePath = "thisfiledoesnotexist"let handleErr err = error $ "got following error: " `mappend` show errExample:0eitherProducer <- t $ fromFileLines goodFilePath1let producer = either handleErr id eitherProducerfmap head $ toListM producer"Proud Pour is a wine company that funds solutions to local environmental"Returns - if there was an error when opening the file./eitherProducer <- t $ fromFileLines badFilePath/either print (const $ return ()) eitherProducer8thisfiledoesnotexist: openBinaryFile: does not exist ... highlightOutput s to .If an  error is thrown, then just  ()4. If any other error is thrown, rethrow the error.Setup for examples::set -XOverloadedStringsimport Pipes ((>->), runEffect)Example:,runEffect $ yield "hello" >-> stderrConsumerhello highlight?Select all immediate children of the given directory, ignoring "." and "..". Throws an  if the directory is not readable or (on Windows) if the directory is actually a reparse point.Setup for examples:import Data.List (sort)import Pipes.Prelude (toListM) Examples:?fmap (head . sort) . toListM $ childOf "test/golden/test-files""test/golden/test-files/dir1"TODO: This could be rewritten to be faster by using the Windows- and Linux-specific functions to only read one file from a directory at a time like the actual  https://hackage.haskell.org/package/dirstream-1.0.3/docs/Data-DirStream.html#v:childOfchildOf function.None 0?)  highlightThis data type specifies how printing filenames will be handled, along with the  function. highlight$Do not print the filename on stdout. highlightPrint the filename on stdout. highlight(This wraps up two pieces of information.One is the value of . This signals as to whether or not we need to print the filename when printing each line of output.This other is a  of  s. This is a " for each line of each input file.)The main job of this module is to define , which produces . 3 is what is processed to figure out what to output. highlight%This is used in two different places. One is in , where a becomes 9. This represents a single file that has been opened.  contains the  and the .  contains the 7 and any errors that occurred when trying to open the .The other is in  and , where a becomes . This represents a single  line from a file, or an error that occurred when trying to read the file. is usually wrapped in a . This is a stream of either s or , lines (with any errors that have occurred). highlight(Place where a file originally came from. highlight3File was specified on the command line by the user. highlightFile was found recursively (not directly specified by the user). highlightStandard input. It was either specified on the command line as -, or used as default because the user did not specify any files. highlightGet a  from a .1let fileOrigin1 = FileSpecifiedByUser "hello.txt";let fileReader1 = FileReaderSuccess fileOrigin1 "some line"'getFileOriginFromFileReader fileReader1FileSpecifiedByUser "hello.txt"0let fileOrigin2 = FileFoundRecursively "bye.txt"let fileReader2 = FileReaderErr fileOrigin2 (userError "err") Nothing'getFileOriginFromFileReader fileReader2FileFoundRecursively "bye.txt" highlightThis is just   .let fileOrigin1 = Stdin;let fileReader1 = FileReaderSuccess fileOrigin1 "some line"%getFilePathFromFileReader fileReader1Nothing0let fileOrigin2 = FileFoundRecursively "bye.txt"let fileReader2 = FileReaderErr fileOrigin2 (userError "err") Nothing%getFilePathFromFileReader fileReader2Just "bye.txt" highlightCreate  based 3 list.Setup for examples::set -XOverloadedStrings>import Highlight.Common.Options (InputFilename(InputFilename))9import Highlight.Common.Options (Recursive(NotRecursive))If the 3 list is empty, just create an  with  and the standard input  passed in.-let stdinProd = yield ("hello" :: ByteString)6let create = createInputData NotRecursive [] stdinProd#InputData NoFilename prod <- create toListM prod![FileReaderSuccess Stdin "hello"]If the 3 list is not empty, create an 6 with lines from each file found on the command line.?@ABBCDEFFGHIJJKLMNNOPQRSTUVWXYZ[\]^_`abcdefghijklmnnopqrsstuvwxyz{|}~                                          (highlight-1.0.0.2-B2MUbH0oCXo3wF9GWQTFi6Highlight.Common.ColorHighlight.Common.OptionsHighlight.Highlight.OptionsHighlight.UtilHighlight.PipesHighlight.Common.Monad.InputHighlight.Common.Monad.OutputHighlight.Common.ErrorHighlight.Common.MonadHighlight.Hrep.MonadHighlight.Hrep.RunHighlight.HrepHighlight.Highlight.MonadHighlight.Highlight.RunHighlight.HighlightcolorForFileNumber allColorsMapallColorsLength allColorsListcolorVividBlackBoldcolorVividBlueBoldcolorVividCyanBoldcolorVividGreenBoldcolorVividMagentaBoldcolorVividRedBoldcolorVividWhiteBoldcolorVividYellowBoldcolorDullBlackBoldcolorDullBlueBoldcolorDullCyanBoldcolorDullGreenBoldcolorDullMagentaBoldcolorDullRedBoldcolorDullWhiteBoldcolorDullYellowBoldcolorVividBlackcolorVividBluecolorVividCyancolorVividGreencolorVividMagenta colorVividRedcolorVividWhitecolorVividYellowcolorDullBlack colorDullBlue colorDullCyancolorDullGreencolorDullMagenta colorDullRedcolorDullWhitecolorDullYellow colorBold colorReset colorNull colorHelpersetSGRCodeBuilderHasCommonOptionscommonOptionsLens CommonOptionscommonOptionsIgnoreCasecommonOptionsRecursivecommonOptionsRawRegexcommonOptionsInputFilenamesHasInputFilenamesinputFilenamesLens InputFilenameunInputFilename HasRawRegex rawRegexLensRawRegex unRawRegex HasRecursive recursiveLens Recursive NotRecursive HasIgnoreCaseignoreCaseLens IgnoreCaseDoNotIgnoreCaseignoreCaseParserrecursiveParserrawRegexParserinputFilenamesParsercommonOptionsParserdefaultCommonOptions$fHasCommonOptionsCommonOptions $fHasInputFilenamesCommonOptions$fHasRawRegexCommonOptions$fHasRecursiveCommonOptions$fHasIgnoreCaseCommonOptions$fEqCommonOptions$fReadCommonOptions$fShowCommonOptions$fEqInputFilename$fIsStringInputFilename$fReadInputFilename$fShowInputFilename $fEqRawRegex$fIsStringRawRegex$fReadRawRegex$fShowRawRegex $fEqRecursive$fReadRecursive$fShowRecursive$fEqIgnoreCase$fReadIgnoreCase$fShowIgnoreCase HasOptions optionsLensOptionsoptionsColorGrepFilenamesoptionsCommonOptionsHasColorGrepFilenamescolorGrepFilenamesLensColorGrepFilenamesDoNotColorGrepFileNamescolorGrepFilenamesParser optionsParserdefaultOptions$fHasInputFilenamesOptions$fHasRawRegexOptions$fHasRecursiveOptions$fHasIgnoreCaseOptions$fHasCommonOptionsOptions$fHasColorGrepFilenamesOptions$fHasOptionsOptions $fEqOptions $fReadOptions $fShowOptions$fEqColorGrepFilenames$fReadColorGrepFilenames$fShowColorGrepFilenamesconvertStringToRawByteStringopenFilePathForReadingcombineApplicativescloseHandleIfEOFOrThrowdie whenNonNullmodify'fromHandleLines stdinLines fromFileLinesstderrConsumerchildOfFilenameHandlingFromFiles NoFilename PrintFilename InputData FileReaderFileReaderSuccess FileReaderErr FileOriginFileSpecifiedByUserFileFoundRecursivelyStdingetFileOriginFromFileReadergetFilePathFromFileReadercreateInputData$fEqFilenameHandlingFromFiles$fReadFilenameHandlingFromFiles$fShowFilenameHandlingFromFiles$fEqFileReader$fShowFileReader$fEqFileOrigin$fReadFileOrigin$fShowFileOriginOutput OutputStdout OutputStderrhandleInputDatarunOutputProducer $fEqOutput $fReadOutput $fShowOutput$fEqFileColorState$fReadFileColorState$fShowFileColorState HighlightErrHighlightRegexCompileErr handleErr$fShowHighlightErrCommonHighlightMunCommonHighlightMrunCommonHighlightMgetIgnoreCaseM getRecursiveM getRawRegexMgetInputFilenamesMthrowHighlightErrthrowRegexCompileErrcompileHighlightRegexWithErrcompileHighlightRegex$fFunctorCommonHighlightM$fApplicativeCommonHighlightM$fMonadCommonHighlightM$fMonadErroreCommonHighlightM$fMonadIOCommonHighlightM$fMonadReaderrCommonHighlightM$fMonadStatesCommonHighlightMHrepMrunHrepMrunproghrepOutputProducerhandleStdinInputformatNormalLinehandleFileInputformatLineWithFilename handleErrorhighlightMatchInRedreplaceInRedByteString defaultMain HighlightMFromGrepFilenameState fromGrepFilenameStatePrevFileNum!fromGrepFilenameStatePrevFilenameinitFromGrepFilenameStateupdateFilenameMupdateFilename runHighlightMgetColorGrepFilenamesMhighlightOutputProducerghc-prim GHC.TypesIntcontainers-0.6.2.1Data.IntMap.InternalIntMapbase Data.Foldablelength+ansi-terminal-0.11.3-9nN8Fk7suriD5I998dZQ1zSystem.Console.ANSI.Types BoldIntensityResetbytestring-0.10.10.0Data.ByteString.Internal ByteStringColorIntensityColorSGRGHC.BaseStringGHC.IOFilePath GHC.IO.IOModeReadMode Data.EitherRightGHC.IO.Handle.TypesHandleLeftGHC.IO.Exception IOException Applicative<> GHC.IO.HandlehIsEOF System.ExitexitWith ExitFailure mtl-2.2.2Control.Monad.State.Classget$!putGHC.IO.Handle.FDstdinstderrForeign.C.ErrorePIPEreturn computeFilenameHandlingFromFiles#pipes-4.3.16-9VXrAzMB3aRDo08ChlGqkD Pipes.CoreProducerfileListProducerfileReaderHandleToLinegetFilePathFromFileOrigin.outputConsumer.regex-with-pcre-1.1.0.1-2iS3QP0AVPZKIWttH7YyKXText.RE.ZeInternals.PCRERE GHC.MaybeJustNothing