summaryrefslogtreecommitdiff
path: root/compiler
diff options
context:
space:
mode:
authorBen Gamari <bgamari.foss@gmail.com>2017-04-25 18:39:58 -0400
committerBen Gamari <ben@smart-cactus.org>2017-04-25 18:41:01 -0400
commit244602697c30e03ba63076941e4742ceeb78dd7c (patch)
tree38a8e56a90d2534e3bccf8ea7addddc476017ee8 /compiler
parentda792e47981f65b2dba4fc76ce51dc3fb9c4c02d (diff)
downloadhaskell-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.pp5
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