úÎ!K>JrNone >HSVX_JFreplace-megaparsecSeparate and capturePParser combinator to find all of the non-overlapping ocurrences of the pattern sep5 in a text stream. Separate the stream into sections:)sections which can parsed by the pattern sep- will be captured as matching sections in 8non-matching sections of the stream will be captured in .¨This parser will always consume its entire input and can never fail. If there are no pattern matches, then the entire input stream will be returned as a non-matching  section.The pattern matching parser sepÿ> will not be allowed to succeed without consuming any input. If we allow the parser to match a zero-width pattern, then it can match the same zero-width pattern again at the same position on the next iteration, which would result in an infinite number of overlapping pattern matches. So, for example, the pattern many digitCharB, which can match zero occurences of a digit, will be treated by sepCap as some digitChar,, and required to match at least one digit.This sepCapd parser combinator is the basis for all of the other features of this module. It is similar to the sep* family of functions found in  Yhttp://hackage.haskell.org/package/parser-combinators/docs/Control-Monad-Combinators.htmlparser-combinators and  Lhttp://hackage.haskell.org/package/parsers/docs/Text-Parser-Combinators.htmlparsers8 but, importantly, it returns the parsed result of the sep% parser instead of throwing it away.replace-megaparsec6Find all occurences, parse and capture pattern matchesFParser combinator for finding all occurences of a pattern in a stream. Will call  with the ? combinator so that the text which matched the pattern parser sep will be returned in the 1 sections, along with the result of the parse of sep. Definition: findAllCap sep =  ( sep) replace-megaparsecFind all occurencesFParser combinator for finding all occurences of a pattern in a stream. Will call  with the B combinator and return the text which matched the pattern parser sep in the  sections. Definition: findAll sep = (fmap.fmap) ( fst) $  ( sep) replace-megaparsec Stream editor~Also known as find-and-replace , or match-and-substitute . Finds all of the sections of the stream which match the pattern sep,, and replaces them with the result of the editor function.QThis function is not a parser combinator,  it is a way to run a parser , like   or  .*Access the matched section of text in the editor0If you want access to the matched string in the editor, function, then combine the pattern parser sep with 0. This will effectively change the type of the editor function to  (s,a) -> s.This allows us to write an editorU function which can choose to not edit the match and just leave it as it is. If the editor< function always returns the first item in the tuple, then  streamEdit changes nothing. So, for all sep:  streamEdit ( sep)  "a  Type constraints6The type of the stream of text that is input must be Stream s such that  Tokens s ~ sp, because we want to output the same type of stream that was input. That requirement is satisfied for all the   instances included with Text.Megaparsec:  Data.Text, Data.Text.Lazy, Data.Bytestring, Data.Bytestring.Lazy, and  Data.String. We need the Monoid s instance so that we can  the output stream.We need  Typeable s and Show s for  ]. In theory this function should never throw an exception, because it only throws when the  parser fails, and the S parser can never fail. If this function ever throws, please report that as a bug.replace-megaparsecStream editor transformerMonad transformer version of .Both the parser sep and the editor/ function run in the underlying monad context.If you want to do   operations in the editor function or the parser sep, then run this in  .If you want the editor function or the parser sep< to remember some state, then run this in a stateful monad.replace-megaparsecThe pattern matching parser sepreplace-megaparsecThe pattern matching parser sepreplace-megaparsecThe pattern matching parser sepreplace-megaparsec The parser sep for the pattern of interest.replace-megaparsecThe editor$ function. Takes a parsed result of sep7 and returns a new stream section for the replacement.replace-megaparsec&The input stream of text to be edited.replace-megaparsec The parser sep for the pattern of interest.replace-megaparsecThe editor$ function. Takes a parsed result of sep7 and returns a new stream section for the replacement.replace-megaparsec&The input stream of text to be edited.       1replace-megaparsec-1.1.2.0-Fz9Cq7MCmsMFRR7I9iX9wgReplace.Megaparsec Data.Tuplefst Data.Functionid Data.MonoidmconcatsepCap findAllCapfindAll streamEdit streamEditTbase Data.EitherRightLeft'megaparsec-7.0.5-9jL5eSrnNXhFsdBflzRXU6Text.MegaparsecmatchData.Bifunctorsecondparse runParserTText.Megaparsec.StreamStream GHC.Exceptionthrowghc-prim GHC.TypesIO