HORIZON HASKELLDocslts/ghc-10.0.x8fef28d2026-11-02Search packagesCtrl K
Theme: |

GHC 10.0.0.20260917 · lts/ghc-10.0.x · 8fef28d · 2026-11-02

ModuleCabal-3.18.1.0Haskell2010

Distribution.Simple.SetupHooks.HooksMain

Implementation of hooks executables for build-type: Hooks packages.

A hooks executable is a small program compiled from the SetupHooks.hs module of a package with build-type: Hooks. Its main function is:

import Distribution.Simple.SetupHooks.HooksMain (hooksMain)
import SetupHooks (setupHooks)
main = hooksMain setupHooks

cabal-install communicates with the external hooks executable to implement the hooks in a package with build-type: Hooks.

Contents
  1. Main entry point for hooks executables
  2. Hooks version handshake
Synopsis
  • PackageCabal-3.18.1.0
  • Exports5
  • LanguageHaskell2010
  • LicenceBSD-3-Clause
  • SourceHooksMain.hs

Main entry point for hooks executables

valuehooksMain :: SetupHooks -> IO ()

Create a hooks executable main given the package's SetupHooks.

The executable expects three command-line arguments:

  1. A reference to an input communication handle (to read hook inputs from).

  2. A reference to an output communication handle (to write hook outputs to).

  3. The hook type to run.

The hook reads binary-encoded data from the input handle, runs the requested hook, and writes the binary-encoded result to the output handle.

Hooks version handshake

datadata HooksVersion

The version of the Hooks API in use.

Used for handshake before beginning inter-process communication.

Instances6Eq, Ord, Show, Generic, Binary, Rep

The version of the Hooks API built into this version of the Cabal library.

Used for handshake before beginning inter-process communication.

datadata CabalABI

Tracks the parts of the Cabal API relevant to its binary interface.

Instances3Generic, Structured, Rep
datadata HooksABI
Instances3Generic, Structured, Rep