Difference between revisions of "Unsafe functions"
Latest revision as of 06:14, 11 August 2022
There are a number of unsafe functions in the libraries.
unsafePerformIO :: IO a -> a
unsafeInterleaveIO :: IO a -> IO a
unsafeInterleaveST :: ST s a -> ST s a
unsafeIOToST :: IO a -> ST s a
unsafeIOToSTM :: IO a -> STM a
unsafeCoerce# :: a -> b
seq :: a -> b -> b
Unsafe functions can break:
- type safety (
- equational reasoning (
- or parametricity (
Their use (except in the case of
seq) would require some
kind of assurance on the part of the programmer that what they're doing
unsafe is also a keyword which can be used in a foreign import declaration.
This article is a stub. You can help by expanding it.