-
Notifications
You must be signed in to change notification settings - Fork 46
Description
I am trying to wrap the Data.Sequence module for use with agda2hs. Rather than to postulate everything, I want to provide a mock definition (backed by Agda Lists) that also reduces within Agda. Therefore, I want a variant of COMPILE pragma that makes these mock definitions ignored like postulates (so that the generated code would import the Haskell module with the same name from containers). In addition, all the additional checks in agda2hs should be turned off for these definitions (as they do not need code generation).
I tried the rewrite rules (the YAML configuration file), but I have two problems with them. First, since I am in charge of the wrapping, I do not want information scattered in both the Agda source file and the YAML configuration. Second, I discovered that the rewrite rules behave differently from COMPILEd definitions. For example, I cannot seem to make agda2hs respect qualified imports (the imported names are always unqualified, clashing with names from Prelude; in the case for modules like Data.Sequence, the convention in Haskell is to always import them qualified).
Am I missing something? Is there already a solution for my problem? If not, do you think it makes sense to have such functionality?
Perhaps we can have some annotations on an Agda module that makes agda2hs skip code-generation for it, or perhaps we can introduce a command-line flag to only perform code-generation for the input Agda file (skipping its dependencies), providing finer-grained control?