HORIZON HASKELLDocslts/ghc-9.10.xc74966e2026-09-27Search names, modules, packages, or :: a typeCtrl K

GHC 9.10.3 · lts/ghc-9.10.x · c74966e · 2026-09-27

Modulepipes-safe-2.3.5Haskell2010

Pipes.Safe.Prelude

Simple resource management functions

  • 8 values
  • Packagepipes-safe-2.3.5
  • Exports8
  • LanguageHaskell2010
  • LicenceBSD-3-Clause
  • SourcePrelude.hs

Handle management

4 declarations

String I/O

2 declarations

Note that Strings are very inefficient, and I will release future separate packages with ByteString and Text operations. I only provide these to allow users to test simple I/O without requiring any additional library dependencies.

Registering/releasing

2 declarations
valueallocate
  1. :: MonadSafe m
  2. => Base m a

    Acquire

  3. -> (a -> Base m ())

    Release

  4. -> m (ReleaseKey, a)
#

Acquire some resource with a guarantee that it will eventually be released

The ReleaseKey can be passed to release to release the resource manually. If this has not been done by the end of the MonadSafe block, the resource will be released automatically.

valueallocate_
  1. :: MonadSafe m
  2. => Base m a

    Acquire

  3. -> Base m ()

    Release

  4. -> m ReleaseKey
#

Like allocate, but for when the resource itself is not needed

The acquire action runs immediately. The ReleaseKey can be passed to release to run the release action. If this has not been done by the end of the MonadSafe block, the release action will be run automatically.