Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Export URI parser #56

Open
ocharles opened this issue Nov 14, 2020 · 5 comments
Open

Export URI parser #56

ocharles opened this issue Nov 14, 2020 · 5 comments

Comments

@ocharles
Copy link

The library exports String -> Maybe URI functions, but this is not easy to compose with other parsers. For example, I'm writing a tokeniser that needs to identify URIs and a bunch of other stuff. I have to do some tedious gymnastics to fit parseURI in, but if I had access to the actual Parser itself, it would be much easier.

@ezrakilty
Copy link
Contributor

I think that's reasonable. My only hesitation would be, it exposes the "implementation detail" of which parser-combinator library we happen to use (Parsec at the moment). That said, the library has been so stable for so long, I doubt we would ever change the combinator library.

I'll work something up that we can talk about.

@ezrakilty
Copy link
Contributor

@ocharles if you have any sample code where you'd like to use these combinators, I'd be interested to see it, to appreciate the need this is filling. Also see the above pull request and let me know what you think.

@ocharles
Copy link
Author

I actually have ended up hand-rolling a parser now, and having the parsec parser exposed probably wouldn't help. My tokeniser is written using regex-applicative, and I was hoping to not need to write a URI parser myself. However, for other reasons the parser I need isn't quite what the URI specification is, anyway.

So tl;dr, I no longer actually need this. I still think it would be worthwhile to export, but can also appreciate not wanting to increase the surface area of the API.

Shall I close this issue, or leave it open?

@ezrakilty
Copy link
Contributor

OK, that makes sense. I'm willing to consider exporting the parser, but in the absence of more people saying they'd like to see it, I'll remain cautious for now.

And, perhaps we'll leave the issue open for now in case others want to voice their interest. Sound good?

@ocharles
Copy link
Author

Perfect!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants