diff options
| author | Ben Gamari <bgamari.foss@gmail.com> | 2017-04-25 18:39:58 -0400 |
|---|---|---|
| committer | Ben Gamari <ben@smart-cactus.org> | 2017-04-25 18:41:01 -0400 |
| commit | 244602697c30e03ba63076941e4742ceeb78dd7c (patch) | |
| tree | 38a8e56a90d2534e3bccf8ea7addddc476017ee8 /compiler | |
| parent | da792e47981f65b2dba4fc76ce51dc3fb9c4c02d (diff) | |
| download | haskell-244602697c30e03ba63076941e4742ceeb78dd7c.tar.gz | |
Document mkWeak#
Reviewers: simonmar, austin
Reviewed By: simonmar
Subscribers: RyanGlScott, rwbarton, thomie
GHC Trac Issues: #10640, #13611
Differential Revision: https://phabricator.haskell.org/D3498
Diffstat (limited to 'compiler')
| -rw-r--r-- | compiler/prelude/primops.txt.pp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/compiler/prelude/primops.txt.pp b/compiler/prelude/primops.txt.pp index 8c9cc92b9a..255235aef3 100644 --- a/compiler/prelude/primops.txt.pp +++ b/compiler/prelude/primops.txt.pp @@ -2382,6 +2382,11 @@ primtype Weak# b primop MkWeakOp "mkWeak#" GenPrimOp o -> b -> (State# RealWorld -> (# State# RealWorld, c #)) -> State# RealWorld -> (# State# RealWorld, Weak# b #) + { {\tt mkWeak# k v finalizer s} creates a weak reference to value {\tt k}, + with an associated reference to some value {\tt v}. If {\tt k} is still + alive then {\tt v} can be retrieved using {\tt deRefWeak#}. Note that + the type of {\tt k} must be represented by a pointer (i.e. of kind {\tt + TYPE 'LiftedRep} or {\tt TYPE 'UnliftedRep}). } with has_side_effects = True out_of_line = True |
