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

Modulebase-4.20.2.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.20.2.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.