Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Below is a builder for Agda libraries. Unlike Haskell, there is no cabal or anything of the sort to tell us about the package. The common practice is for authors to expose a file to compile, commonly
Everything.agda
.Simply, it does the following
-i
flags to call agda withnix-shell
we now have to only callagda
and all our dependencies are accounted for.buildTools
don't get accounted for here.$out/share/agda
. There is no canonical place to put it but if all packages put it there then we can always find the files that way. An alternative way would be to put a script at the top level at build time which can tell us where in the tree to find the files but benefit of this is dubious and I feel user-experience would suffer.As proof of concept I converted the existing stdlib expression to use the new builder. I also packaged the
categories
library using it. It's not included because it the library happens to not compile with the recent update to Agda 2.4.2 but otherwise there is nothing wrong with it, I tested with previous version. You can see the expression here. As you can see it's nice and short.This is a step up from how
stdlib
was packaged: abuse the cabal file inside of it and do everything manually inpostInstall
.I think this could be made more resillent but I think most of all it just needs a bit of testing by others. cc @JohnW who's listed under Agda things.