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

GHC 9.14.1 · lts/ghc-9.14.x · 3e2d568 · 2026-10-11

Modulebase-4.22.0.0Haskell2010

Control.Monad.ST.Unsafe

This module provides support for strict state threads, as described in the PLDI '94 paper by John Launchbury and Simon Peyton Jones Lazy Functional State Threads.

Unsafe API.

  • 4 values
  • Packagebase-4.22.0.0
  • Exports4
  • LanguageHaskell2010
  • LicenceBSD-3-Clause
  • SourceUnsafe.hs

Unsafe operations

4 declarations
valueunsafeInterleaveST :: ST s a -> ST s a
#

unsafeInterleaveST allows an ST computation to be deferred lazily. When passed a value of type ST a, the ST computation will only be performed when the value of the a is demanded.

valueunsafeDupableInterleaveST :: ST s a -> ST s a
#

unsafeDupableInterleaveST allows an ST computation to be deferred lazily. When passed a value of type ST a, the ST computation will only be performed when the value of the a is demanded.

The computation may be performed multiple times by different threads, possibly at the same time. To prevent this, use unsafeInterleaveST instead.

valueunsafeIOToST :: IO a -> ST s a
#

Convert an IO action to an ST action. This relies on IO and ST having the same representation modulo the constraint on the state thread type parameter.