... | ... | @@ -14,7 +14,7 @@ Although interface files are kept in binary format, you can print them in human- |
|
|
```
|
|
|
|
|
|
|
|
|
This textual format is not particularly designed for machine parsing. Doing so might be possible, but if you want to read GHC interface files you are almost certainly better off using the [GHC API](commentary/compiler/api) to do so. If you are wondering how some particular language feature is represented in the interface file, this command is really useful! Cross-reference its output with the `Outputable` instance defined in [compiler/iface/LoadIface.hs](https://gitlab.haskell.org/ghc/ghc/tree/master/ghc/compiler/iface/LoadIface.hs)
|
|
|
This textual format is not particularly designed for machine parsing. Doing so might be possible, but if you want to read GHC interface files you are almost certainly better off using the [GHC API](commentary/compiler/api) to do so. If you are wondering how some particular language feature is represented in the interface file, this command is really useful! Cross-reference its output with the `Outputable` instance defined in [compiler/iface/LoadIface.hs](https://gitlab.haskell.org/ghc/ghc/blob/master/compiler/iface/LoadIface.hs)
|
|
|
|
|
|
|
|
|
Here are some of the things stored in an interface file `M.hi`
|
... | ... | @@ -26,7 +26,7 @@ Here are some of the things stored in an interface file `M.hi` |
|
|
- The strictness, arity, and unfolding of exported functions. This is crucial for cross-module optimisation; but it is only included when you compile with `-O`.
|
|
|
|
|
|
|
|
|
The contents of an interface file is the result of serialising the **`IfaceSyn`** family of data types. The data types are in [compiler/iface/IfaceSyn.hs](https://gitlab.haskell.org/ghc/ghc/tree/master/ghc/compiler/iface/IfaceSyn.hs) and [compiler/iface/IfaceType.hs](https://gitlab.haskell.org/ghc/ghc/blob/master/compiler/iface/IfaceType.hs); the binary serialisation code is in [compiler/iface/BinIface.hs](https://gitlab.haskell.org/ghc/ghc/blob/master/compiler/iface/BinIface.hs). The definition of a module interface is the **`ModIface`** data type in [compiler/main/HscTypes.hs](https://gitlab.haskell.org/ghc/ghc/blob/master/compiler/main/HscTypes.hs).
|
|
|
The contents of an interface file is the result of serialising the **`IfaceSyn`** family of data types. The data types are in [compiler/iface/IfaceSyn.hs](https://gitlab.haskell.org/ghc/ghc/blob/master/compiler/iface/IfaceSyn.hs) and [compiler/iface/IfaceType.hs](https://gitlab.haskell.org/ghc/ghc/blob/master/compiler/iface/IfaceType.hs); the binary serialisation code is in [compiler/iface/BinIface.hs](https://gitlab.haskell.org/ghc/ghc/blob/master/compiler/iface/BinIface.hs). The definition of a module interface is the **`ModIface`** data type in [compiler/main/HscTypes.hs](https://gitlab.haskell.org/ghc/ghc/blob/master/compiler/main/HscTypes.hs).
|
|
|
|
|
|
|
|
|
Details of some of the types involved in GHC's representation of Modules and Interface files can be found [here](commentary/compiler/module-types).
|
... | ... | |