You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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 thatHarp.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 thatHarp.Match
could not be found in any package - withoutHarp.Match
being mentioned by the user's code. By forcing users to explicitly import, they will also (at least in theory) realize that they needharp
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.
The text was updated successfully, but these errors were encountered: