Open jonkri opened 4 days ago
@jonkri, I'll improve the package's documentation.
In advance of that, this package was spun out of the Stack project. Stack needs certain information (only) from GHC's *.hi
files (which can vary in format from one version of GHC to another; GHC makes no promises in that regard) and also needs to work with different versions of GHC (so it can't be built against a single ghc
package version). It also needs the information faster than GHC's --show-iface
can provide.
The ghc
package has module GHC.Iface.Load
(and GHC.Iface.Load.readIface
) if you are looking for GHC-version specific functionality.
In principle, this package could be extended to provide other information, in addition to what Stack itself needs. However, as Stack is dependent on it, that would need to be done carefully, so as not to break Stack.
I would like to suggest adding a high-level description about what this library can be used for.
I stumbled across this library looking for ways to analyze dependencies for my master's thesis.
I was expecting the library to produce a values corresponding to
ghc --show-iface test.hi
:Instead, I got this:
["/Users/jonkri/.ghcup/ghc/9.6.6/lib/ghc-9.6.6/lib/../lib/aarch64-osx-ghc-9.6.6/rts-1.0.2/include/ghcversion.h","/Volumes/Expansion/Haskell Packages/abstract-deque-0.3/dist-newstyle/build/aarch64-osx/ghc-9.6.6/abstract-deque-0.3/build/autogen/cabal_macros.h"]
Dependencies {dmods = [], dpkgs = [("base",True)], dorphs = ["GHC.Base","GHC.Float","GHC.Prim.Ext"], dfinsts = ["Control.Applicative","Control.Arrow","Data.Functor.Const","Data.Functor.Identity","Data.Monoid","Data.Semigroup.Internal","Data.Type.Ord","GHC.Generics","GHC.IO.Exception","GHC.RTS.Flags"], dplugins = []}
The package and module in question is abstract-deque-0.3 and
Data.Concurrent.Deque.Class
.Am I doing something wrong? Is there a way to use this library to parse additional details from the
.hi
files?Thanks!