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

Factor out common parts of types/{Library,ForeignLibrary,Executable,Benchmark,TestSuite}.dhall #60

Closed
quasicomputational opened this issue May 22, 2018 · 0 comments · Fixed by #64

Comments

@quasicomputational
Copy link
Collaborator

quasicomputational commented May 22, 2018

Most of all of those files are what we might call 'BuildInfo', following Cabal, plus a few component-specific fields. When that code was written, Dhall didn't have a way to combine record types. But now the //\\ operator is a thing, and we can factor out all 28 or so shared fields (plus another 10 when #42 lands) into a new file types/BuildInfo.dhall, and then define them with reference to that plus their idiosyncratic fields.

This has an additional benefit because then you can define libraryBuildInfo : Library -> BuildInfo, executableBuildInfo, etc, and then write mapBuildInfo : (BuildInfo ->Config -> BuildInfo) -> Package -> Package to, e.g., conveniently add warnings to all components.

It'd be nice if --print-type would output the build components in terms of BuildInfo too.

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

Successfully merging a pull request may close this issue.

1 participant