
Hello, in Distribution.PackageDescription, one library may be given, but in Distribution.InstalledPackageInfo, several libraryDirs, importDirs, includeDirs, haddockInterfaces, haddockHTMLs may exist. Why is this? How could there be more than one of these paths if there is just one library? I'm sure I miss some critical design decision. Thanks, Sascha

On 18 jul 2007, at 08.43, Sascha Böhme wrote:
Hello,
in Distribution.PackageDescription, one library may be given, but in Distribution.InstalledPackageInfo, several libraryDirs, importDirs, includeDirs, haddockInterfaces, haddockHTMLs may exist. Why is this? How could there be more than one of these paths if there is just one library? I'm sure I miss some critical design decision.
(Just a guess.) InstalledPackageDescription is different in that its format is not controlled by Cabal, but rather by the particular compiler. It happens to be the case, that the formats are very similar, but there are some differences among Hugs, nhc, GHC, etc.. This data structure just captures these. PackageDescription, OTOH, reflects Cabal's current capabilities. HTH, / Thomas

On Wed, Jul 18, 2007 at 08:43:53AM +0200, Sascha Böhme wrote:
in Distribution.PackageDescription, one library may be given, but in Distribution.InstalledPackageInfo, several libraryDirs, importDirs, includeDirs, haddockInterfaces, haddockHTMLs may exist. Why is this? How could there be more than one of these paths if there is just one library? I'm sure I miss some critical design decision.
The Library type includes a BuildInfo, which contains several fields which are often similar to those in InstalledPackageInfo. They're not the same though, because BuildInfo contains information needed to build the package, while InstalledPackageInfo contains information needed to build other programs and packages that use this package.
participants (3)
-
Ross Paterson
-
Sascha Böhme
-
Thomas Schilling