-
Notifications
You must be signed in to change notification settings - Fork 339
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
Avoid discarding cached interfaces #2767
Comments
Would it help to turn |
I don't think it should be possible to change the include directories inside a module. |
I guess the right thing to do would be to keep the cached interfaces and check that they refer to the module you expect when trying to load them. |
I assume that you mean file rather than module. I don't think it's quite as easy as that. What if you have changed the include path so that some module that the given file depends on now resides in a different file? |
Right. I believe we store the module (file? I'm unclear on when I'm allowed to use which word) dependencies in the interface. Maybe the best thing to do would be to prune the cached interfaces when the include path changes and throw out any interfaces with changed dependencies. |
Ulf Norell provided help with the design of this change.
Ulf Norell provided help with the design of this change.
I've implemented something like that. Switching between different libraries can still be slow. One could imagine storing the decoded libraries that are now discarded in a separate data structure, and reusing them if, say, the old include paths are restored (and nothing else has changed). However, I don't think we should waste memory on this. |
Ulf Norell provided help with the design of this change. src/full/Agda/TypeChecking/Monad/Options.hs
Ulf Norell provided help with the design of this change. src/full/Agda/TypeChecking/Monad/Options.hs
I often use the following setup in my Agda libraries:
src
../README.agda
that provides an overview over the library, importing modules located insrc
..agda-lib
file listssrc
as the onlyinclude
directory.In order to be able to type-check
./README.agda
I include-i.
in the Agda program options. However, this has a drawback: If I load./README.agda
and then load some file insrc
, then Agda discards cached interface files, because the include directories have changed. As a workaround I sometimes temporarily put.
in theinclude
directories. I would like to find a more principled solution to this problem.The text was updated successfully, but these errors were encountered: