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 <[email protected]>: > On Mon, Feb 20, 2017 at 10:27 PM, Artyom Shalkhakov > <[email protected]> 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 > [email protected] > http://www.impredicative.com/cgi-bin/mailman/listinfo/ur > -- Cheers, Artyom Shalkhakov
_______________________________________________ Ur mailing list [email protected] http://www.impredicative.com/cgi-bin/mailman/listinfo/ur
