getting addDependFile from a hi file

Njagi Mwaniki mwanikibusiness at gmail.com
Sun Aug 16 21:08:40 UTC 2015


Hello,

I have a case in which I wish to parse a hi file to extract the
addDependentFile section created by template haskell.

I found the function `readBinIface :: CheckHiWay -> TraceBinIFaceReading
-> FilePath -> TcRnIf a b ModIface`
https://downloads.haskell.org/~ghc/7.10.2/docs/html/libraries/ghc-7.10.2/BinIface.html#v:readBinIface

I want to use the ModIface type to extract the mi_usages where I believe
I will find the list of dependent files.

The issue is that I can't extract a value of type ModIface due to the
strict dependence on Env of values that are related to this. I don't
understand what env is and despite reading about the docs extensively I
can't find a function explaining how to work with the env value or how
to generate one. The closest thing I found was in TcRnMonad.getTopEnv
but even that is cryptic. Could I get some help.

All in all, I just want to get the addDependFile section from a hi file.


More information about the ghc-devs mailing list