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.
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 declarationsunsafeDupableInterleaveST 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.
Convert an ST action to an IO action. This relies on IO and ST having the same representation modulo the constraint on the state thread type parameter.
For an example demonstrating why this is unsafe, see https://mail.haskell.org/pipermail/haskell-cafe/2009-April/060719.html