[Ur] Regular expressions DSEL?
Artyom Shalkhakov
artyom.shalkhakov at gmail.com
Thu Feb 23 10:55:43 EST 2017
Hello Benjamin, Ziv,
I wrote a very rough approximation to the idea that Ziv proposed, here's
the code (currently, it does not do much):
https://github.com/ashalkhakov/urweb-regex/tree/typed-regex
At first I was thinking that it would be better to introduce named groups,
but now I'm wondering how to handle positional groups, instead?
Tangentially, I also noticed that JS does not handle capture groups mixed
with repetition, e.g.
'xabxabxab'.match(/(xab){3}/) // or with /(xab)*/
gives: ["xabxabxab", "xab"] (would it be worth it to try to rule out cases
like this statically? probably not?)
2017-02-21 21:21 GMT+06:00 Benjamin Barenblat <bbaren at mit.edu>:
> On Mon, Feb 20, 2017 at 10:27 PM, Artyom Shalkhakov
> <artyom.shalkhakov at gmail.com> wrote:
> > Thank you for the pointer. I guess creating a new package that depends on
> > urweb-regex is the way to go.
>
> I’m also happy to merge changes to urweb-regex. I think a richly-typed
> API like the one you’re looking for would be quite valuable in the
> regex library.
>
> _______________________________________________
> Ur mailing list
> Ur at impredicative.com
> http://www.impredicative.com/cgi-bin/mailman/listinfo/ur
>
--
Cheers,
Artyom Shalkhakov
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.impredicative.com/pipermail/ur/attachments/20170223/a0cdaeb9/attachment.html>
More information about the Ur
mailing list