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 <ghc-devs@haskell.org> | Subject: 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://na01.safelinks.protection.outlook.com/?url=https%3a%2f%2fwww.jo | achim- | breitner.de%2f&data=01%7c01%7csimonpj%40064d.mgd.microsoft.com%7cd7df37 | ec4e6f406c455808d34e5df68b%7c72f988bf86f141af91ab2d7cd011db47%7c1&sdata | =pigxxB7cDKt7AZbAUOHHK17%2bqcvJAXtmErf6HJPHCFs%3d | XMPP: nomeata@joachim-breitner.de • OpenPGP-Key: 0xF0FBF51F | Debian Developer: nomeata@debian.org
participants (2)
-
Joachim Breitner -
Simon Peyton Jones