Should we have primitive fill-once variables?

David Feuer david at well-typed.com
Fri Jun 29 17:59:41 UTC 2018


On Friday, June 29, 2018 12:54:23 PM EDT David Feuer wrote:

> The unboxed tuple allows the value to be extracted from the IVar without being forced. If, however, we want QVars, we can always simulate that using accursedUnutterablePerformIO:

Actually, this might be silly, depending on implementation details. Twan's technique (which may or may not be directly relevant) overwrites a closure with its final value, which is a pretty good match for your approach. We still need to be able to implement tryRead[IQ]Var; I'm not sure what limitations that imposes.


More information about the ghc-devs mailing list