HORIZON HASKELLDocslts/ghc-10.0.xfc4e5982026-10-11Search names, modules, packages, or :: a typeCtrl K

GHC 10.0.0.20260917 · lts/ghc-10.0.x · fc4e598 · 2026-10-11

Moduleghc-10.0.0.20260917GHC2024

GHC.Iface.Binary

Binary interface file support.

  • 4 types
  • 14 values

Public API for interface file serialisation

11 declarations
datadata CompressionIFace
#

The compression/deduplication level of ModIface files.

A ModIface contains many duplicated symbols and names. To keep interface files small, we deduplicate them during serialisation. It is impossible to write an interface file with *no* compression/deduplication.

We support different levels of compression/deduplication, with different trade-offs for run-time performance and memory usage. If you don't have any specific requirements, then SafeExtraCompression is a good default.

Constructors

  • NormalCompression

    Perform the normal compression operations, such as deduplicating Names and FastStrings

  • SafeExtraCompression

    Perform some extra compression steps that have minimal impact on the run-time of ghc.

    This reduces the size of '.hi' files significantly in some cases and reduces overall memory usage in certain scenarios.

  • MaximumCompression

    Try to compress as much as possible.

    Yields the smallest '.hi' files but at the cost of additional run-time.

Instances6Bounded, Enum, Eq, Ord, Show, Outputable

This performs a get action after reading the dictionary and symbol table. It is necessary to run this before trying to deserialise any Names or FastStrings.

Internal serialisation functions

7 declarations
valueputAllTables :: WriteBinHandle -> [WriterTable] -> IO b -> IO ([Int], b)
#

Write all deduplication tables to disk after serialising the main payload.

Writes forward pointers to the deduplication tables before writing the payload to allow deserialisation *before* the payload is read again.