| ||||||||

| ||||||||

Description | ||||||||

This is a module of instances of These instances work for all the supported types and backends
interchangably. These instances provide the different results that
can be gotten from a match or matchM operation (often via the
There are a few type synonyms from RegexLike that are used here: -- | 0 based index from start of source, or (-1) for unused type MatchOffset = Int -- | non-negative length of a match type MatchLength = Int type MatchArray = Array Int (MatchOffset, MatchLength) type MatchText source = Array Int (source, (MatchOffset, MatchLength)) There are also a few newtypes that used to prevent any possible overlap of types, which were not needed for GHC's late overlap detection but are needed for use in Hugs. newtype AllSubmatches f b = AllSubmatches {getAllSubmatches :: (f b)} newtype AllTextSubmatches f b = AllTextSubmatches {getAllTextSubmatches :: (f b)} newtype AllMatches f b = AllMatches {getAllMatches :: (f b)} newtype AllTextMatches f b = AllTextMatches {getAllTextMatches :: (f b) } The newtypes' The two *Submatches newtypes return only information on the first match. The other two newtypes return information on all the non-overlapping matches. The two *Text* newtypes are used to mark result types that contain the same type as the target text. Where provided, noncaptured submatches will have a XXX THIS HADDOCK DOCUMENTATION IS OUT OF DATE XXX These are for finding the first match in the target text:
Two containers of the submatch offset information:
Two containers of the submatch text and offset information: RegexContext a b (AllTextSubmatches (Array Int) (b, (MatchOffset, MatchLength))) RegexContext a b (AllTextSubmatches [] (b, (MatchOffset, MatchLength))) Two containers of the submatch text information: RegexContext a b (AllTextSubmatches [] b) RegexContext a b (AllTextSubmatches (Array Int) b) These instances are for all the matches (non-overlapping). Note that
backends are supposed to supply
Two containers for locations of all matches: RegexContext a b (AllMatches [] (MatchOffset, MatchLength)) RegexContext a b (AllMatches (Array Int) (MatchOffset,MatchLength)) Two containers for the locations of all matches and their submatches:
RegexContext a b (AllMatches (Array Int) MatchArray) Two containers for the text and locations of all matches and their submatches: RegexContext a b [MatchText b] RegexContext a b (AllTextMatches (Array Int) (MatchText b)) Two containers for text of all matches:
RegexContext a b (AllTextMatches (Array Int) b) Four containers for text of all matches and their submatches: RegexContext a b [[b]] RegexContext a b (AllTextMatches (Array Int) [b]) RegexContext a b (AllTextMatches [] (Array Int b)) RegexContext a b (AllTextMatches (Array Int) (Array Int b)) | ||||||||

Produced by Haddock version 0.8 |