BC fix: libraries -> library/subLibraries (#3574)#3580
Merged
ezyang merged 1 commit intohaskell:masterfrom Jul 22, 2016
Merged
Conversation
| withLib :: PackageDescription -> (Library -> IO ()) -> IO () | ||
| withLib pkg_descr f = | ||
| sequence_ [f lib | lib <- libraries pkg_descr, buildable (libBuildInfo lib)] | ||
| withLib pkg_descr f = do |
6edf9c4 to
50c0522
Compare
bfd2e7e to
da6ce0d
Compare
The resulting code is more verbose, but it is more backwards-compatible and actually is simpler to understand in some cases (because CLibName uniquely identifies the "public library"; no faffing about with package names to figure it out.) Signed-off-by: Edward Z. Yang <ezyang@cs.stanford.edu>
da6ce0d to
c421cb7
Compare
| -- in the top-level directory in dist, so no conflicts either. | ||
| libNames = filter (/= unPackageName (packageName pkg)) . map libName $ libraries pkg | ||
| -- the same as the package. | ||
| subLibNames = catMaybes . map libName $ subLibraries pkg |
Member
There was a problem hiding this comment.
Shouldn't this be map (fromMaybe (packageName pkg) . libName) $ subLibraries?
Contributor
Author
There was a problem hiding this comment.
Mmm. I guess the invariant is that everything in subLibraries has a non-Nothing package name. I guess we can check that!
Member
There was a problem hiding this comment.
Yeah, I was looking for such a check, but it seem we don't have one.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
The resulting code is more verbose, but it is more backwards-compatible
and actually is simpler to understand in some cases (because
CLibName uniquely identifies the "public library"; no faffing
about with package names to figure it out.)
Signed-off-by: Edward Z. Yang ezyang@cs.stanford.edu