Closed rightfold closed 7 years ago
👍 Except that usually we separate unsafe functions into sub modules like Data.String.Regex.Unsafe
or Data.String.Regex.Partial
.
Seems reasonable, requires another import though. The goal is mostly to reduce the amount of boilerplate needed for (poor man's) regex literals.
Yes, could we please move this into Data.String.Regex.Partial
? Looks good otherwise.
Probably should be Data.String.Regex.Unsafe
in this case, since there's no partial constraint?
Could possibly have a Partial
version too/instead.
We already have a Partial
version - that's the normal version :smile:, this is a convenience to avoid that.
Well, kinda. Having a Partial
verison would eliminate the need for fromRight
, but that's not really much better.
@garyb you mean eliminate the need for unsafePartial
, right? The fromRight
is what would make this need a Partial
constraint.
I meant if we had Partial => String -> RegexFlags -> Regex
you'd still end up having to always unsafePartial
for the case in the linked issue, so just providing a fully unsafe version is the only way to avoid the annoyance :)
Yeah, it's the use of the function we want to make easier, not the definition.
@garyb oh you meant: eliminate the need for fromRight
on use, not on definition
I'll move the function to .Unsafe
.
Great, thanks!
Fixes #73.