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

Should Harp.Match be auto-imported? #4

Open
niklasbroberg opened this issue Nov 10, 2014 · 0 comments
Open

Should Harp.Match be auto-imported? #4

niklasbroberg opened this issue Nov 10, 2014 · 0 comments

Comments

@niklasbroberg
Copy link
Contributor

If the transformer finds any occurrence of regular patterns in the AST, it will automatically add the import import qualified Harp.Match as HaRPMatch. This is consistent with the view that Harp.Match is the "Prelude" of regular patterns, and it intends to ensure that no name clashes happen, but in practice this leads to some issues.

Firstly, if the harp package is not installed, users get an error saying that Harp.Match could not be found in any package - without Harp.Match being mentioned by the user's code. By forcing users to explicitly import, they will also (at least in theory) realize that they need harp installed.

Second, and perhaps more academic in nature, not forcing a specific import of the "backend" would open for the possibility of using different backends. This is the justification we used for removing the auto-import of HSP when transforming code containing XmlSyntax. Now, the backend for HaRP is very simple and specific and it might not even make sense in practice to replace it with something else.

I'm not sure what the correct way is here, but I want to document these thoughts somewhere.

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

1 participant