Copyright | (c) Alexey Kuleshevich 2020 |
---|---|
License | BSD3 |
Maintainer | Alexey Kuleshevich <alexey@kuleshevi.ch> |
Stability | experimental |
Portability | non-portable |
Safe Haskell | None |
Language | Haskell2010 |
Synopsis
- touch :: MonadPrim s m => a -> m ()
- seqPrim :: MonadPrim s m => a -> m a
- keepAlive# :: a -> (State# s -> (#State# s, r#)) -> State# s -> (#State# s, r#)
- withAlivePrimBase :: (MonadPrimBase s n, MonadPrim s m) => a -> n b -> m b
- withAliveUnliftPrim :: MonadUnliftPrim s m => a -> m b -> m b
Documentation
touch :: MonadPrim s m => a -> m () Source #
This is an action that ensures that the value is still available and garbage collector has not cleaned it up.
Make sure not to use it after some computation that doesn't return, like after
forever
for example, otherwise touch will simply be removed by ghc and bad things
will happen. If you have a case like that, make sure to use withAlivePrimBase
or
withAliveUnliftPrim
instead.
Since: 0.1.0
:: (MonadPrimBase s n, MonadPrim s m) | |
=> a | The value to preserve |
-> n b | Action to run in which the value will be preserved |
-> m b |
Similar to touch
. See withAlive#
for more info.
Since: 0.1.0
:: MonadUnliftPrim s m | |
=> a | The value to preserve |
-> m b | Action to run in which the value will be preserved |
-> m b |
Similar to touch
. See withAlive#
for more info.
Since: 0.1.0