Closed elldritch closed 2 years ago
just use the
Read
instance forInstalledPackageInfo
I'm an idiot. I thought this was a parser, but it's just a derived instance. :disappointed:
Nice find! I wondered if something like that was happening, but I think as is often the case with alternative preludes, the point is moot as you're going to be including it in every module. I do think this is a good idea though, and to answer your question I haven't seen it before but it would appear it's related to re-exports, as you suggest.
I was using this tool on one of my projects that uses Relude, an alternative Prelude. Interestingly, this tool appears to always report that
relude
is an unused dependency. I dug into the source code to see why.I think the issue is in
getDependencyByModule
andparsePkg
inData.Prune.Dependency
, where this tool appears to believe thatrelude
only exportsData.ByteString
. I think the root cause of this is a very, very weirdexposed-modules
entry when runningghc-pkg dump
. Check out the dump forrelude
:Notice the output format in
exposed-modules
using comma-delimited names andMODULE from PACKAGE
entries. I've never seen this format before, and I couldn't find this format being used to describe theexposed-modules
of any other package in my projects. Have you seen this before? Is this due to a module re-export?This output seems to break the
exposedModules
parser, which does not support this format. I'm happy to contribute a PR to add this format to the parser, but I'm curious about whether you've seen this output format before. I can't find any documentation on it.Given that
parseDependencyName
andparseExposedModules
both seem to only ever be used inghc-pkg
output parsing, I'm tempted to try to toss the whole parser and just use theRead
instance forInstalledPackageInfo
. Any objections to that?