HORIZON HASKELLDocslts/ghc-9.10.x248f8f02026-10-05Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · 248f8f0 · 2026-10-05

ModuleCabal-3.12.1.0Haskell2010

Distribution.Compat.CreatePipe

Deprecated. Use System.Process from package process directly

  • 1 value
  • PackageCabal-3.12.1.0
  • Exports1
  • LanguageHaskell2010
  • LicenceBSD-3-Clause
  • SourceInternals.hs
valuecreatePipe :: IO (Handle, Handle)
#

Create a pipe for interprocess communication and return a (readEnd, writeEnd) Handle pair.

  • WinIO Support

When this function is used with WinIO enabled it's the caller's responsibility to register the handles with the I/O manager. If this is not done the operation will deadlock. Association can be done as follows:

    #if defined(IO_MANAGER_WINIO)
    import GHC.IO.SubSystem ((<!>))
    import GHC.IO.Handle.Windows (handleToHANDLE)
    import GHC.Event.Windows (associateHandle')
    #endif

    ...

    #if defined(IO_MANAGER_WINIO)
    return () <!> do
      associateHandle' =<< handleToHANDLE readEnd
    #endif

Only associate handles that you are in charge of read/writing to. Do not associate handles passed to another process. It's the process's responsibility to register the handle if it supports async access.