Filip Wiesner
01/06/2022, 7:32 AMremember { ... }
equal to remember(Unit) { ... }
?
Or does the Unit
key override the implicit key derived from call order? Am I just overthinking things?Filip Wiesner
01/06/2022, 8:58 AMChuck Jazdzewski [G]
01/06/2022, 11:53 PMremember { ... }
is more efficient as it doesn't needlessly store Unit
in the slot table and compare it. In both cases remember
can be thought of as implicitly having a key that is its position in composition (the inspiration for the the name "positional memoization"). Adding a key to remember
does not replace the positional key, it adds to it to form a composite key that when the composite key changes the lambda is reinvoked to produce a new value.FunkyMuse
01/07/2022, 4:34 PMChuck Jazdzewski [G]
01/07/2022, 5:22 PMremember
appears in the composable function call graph. Since the slot table stores a linear record of the call graph, the location in the slot table is sufficient to determine which remember is being referenced.Filip Wiesner
01/07/2022, 6:41 PM