No tests/examples for mkRegexQQ? Plus some other functions missing tests #5

Open
opened 2024-06-22 12:02:28 +02:00 by phlummox · 1 comment

Are there any tests or examples showing mkRegexQQ in use? I looked but couldn't see any.

There also don't seem to be tests or examples for: scanO, scanRangesO, subO, gsubO, splitO, compileM (when used with a non-empty list of PCREOptions), and rawSub. I am sure their use is obvious to someone already familiar with the package, but for a newcomer, it's really helpful if thorough examples can be included.

Are there any tests or examples showing `mkRegexQQ` in use? I looked but couldn't see any. There also don't seem to be tests or examples for: `scanO`, `scanRangesO`, `subO`, `gsubO`, `splitO`, `compileM` (when used with a non-empty list of `PCREOption`s), and `rawSub`. I am sure their use is obvious to someone already familiar with the package, but for a newcomer, it's really helpful if thorough examples can be included.
Owner

re itself is an example of mkRegexQQ, naturally:

re  QuasiQuoter
re = mkRegexQQ [utf8]

So if you have a need to provide custom PCREOptions other than utf8, you can make your own re. If you don't, just don't worry and pretend it does not exist.

it's really helpful if thorough examples can be included

Sure! Feel free to submit a patch adding them (:

IIRC, I never came up with any examples because I never had a need to use any of the options. All of this was designed very "inside-out", not "outside-in", i.e. there is a way to pass options just because the underlying library has them, not because anyone in particular had a practical need to use them.

`re` itself is an example of `mkRegexQQ`, naturally: ```haskell re ∷ QuasiQuoter re = mkRegexQQ [utf8] ``` So if you have a need to provide custom `PCREOption`s other than `utf8`, you can make your own `re`. If you don't, just don't worry and pretend it does not exist. > it's really helpful if thorough examples can be included Sure! Feel free to submit a patch adding them (: IIRC, I never came up with any examples because I never had a need to use any of the options. All of this was designed very "inside-out", not "outside-in", i.e. there is a way to pass options just *because the underlying library has them*, not because anyone in particular had a practical need to use them.
Sign in to join this conversation.
No labels
No milestone
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
valpackett/pcre-heavy#5
No description provided.