Updatable, single entry, one-short thunks and lambda

Dear list, in the literature, the code and the comments, I often find these notions: * updatable * single-entry * one-shot applied to thunks, functions, closures and lambda expressions on various levels I have the impression that these are indeed plain synonyms (resp. antinyms) when it comes to thunks and other closures, and indicate whether a dynamic instance of this closure is going to be entered once or more than once, while "one-shot", when applied to a lambda expression (or, by extension function argument), indicates that this lambda expression is _called_ at most once for every _evaluation_ of it. Is that about right, or are there more pitfalls around? Greetings, Joachim -- Joachim “nomeata” Breitner mail@joachim-breitner.de • https://www.joachim-breitner.de/ XMPP: nomeata@joachim-breitner.de • OpenPGP-Key: 0xF0FBF51F Debian Developer: nomeata@debian.org

Hi, Am Donnerstag, den 17.03.2016, 13:16 +0100 schrieb Joachim Breitner:
in the literature, the code and the comments, I often find these notions: * updatable * single-entry * one-shot applied to thunks, functions, closures and lambda expressions on various levels
I have the impression that these are indeed plain synonyms (resp. antinyms) when it comes to thunks and other closures, and indicate whether a dynamic instance of this closure is going to be entered once or more than once.
More code reading¹ indicates that updatable and single-entry are antinyms for Thunks, but other closures are always "not updatable" and "not (necessarily) single entry". Greetings, Joachim ¹ closureUpdReqd and closureSingleEntry in StgCmmClosure. -- Joachim “nomeata” Breitner mail@joachim-breitner.de • https://www.joachim-breitner.de/ XMPP: nomeata@joachim-breitner.de • OpenPGP-Key: 0xF0FBF51F Debian Developer: nomeata@debian.org

Updatable
- is it updated after its value has been computed?
- thunks only
- a non-updatable thunk will effectively be call-by-name,
so it should either be cheap or single-entry
Single-entry
- is it entered (called) once or zero times?
- thunks or functions
One-shot: same as single-entry
| -----Original Message-----
| From: ghc-devs [mailto:ghc-devs-bounces@haskell.org] On Behalf Of
| Joachim Breitner
| Sent: 17 March 2016 12:16
| To: GHC developers
participants (2)
-
Joachim Breitner
-
Simon Peyton Jones