support reverting CAFs in
interpreted code at the moment, you have to reload the module.
So you need the following things:
- modify the GC to revert CAFs when they become garbage
- add a primop to revert a single CAF
not too hard, I would think...
Good to know. I'll take a look at it over
On 07/12/11 15:16, Twan van Laarhoven wrote:
On 06/12/11 18:48, wren ng thornton wrote:
So, I have an optimization/internals question. Does the GHC API have any
hooks for being able to revert a CAF to the original expression, thus
discarding the previously computed result?
...
I could hack
On 06/12/2011 17:48, wren ng thornton wrote:
So, I have an optimization/internals question. Does the GHC API have any
hooks for being able to revert a CAF to the original expression, thus
discarding the previously computed result?
The reason I'm wanting this is that I have a particular CAF
On 06/12/11 18:48, wren ng thornton wrote:
So, I have an optimization/internals question. Does the GHC API have any
hooks for being able to revert a CAF to the original expression, thus
discarding the previously computed result?
...
I could hack something together based on unsafePerformIO
So, I have an optimization/internals question. Does the GHC API have any
hooks for being able to revert a CAF to the original expression, thus
discarding the previously computed result?
The reason I'm wanting this is that I have a particular CAF which is an
infinite list. Unfolding that list
| Subject: Revert a CAF?
|
| So, I have an optimization/internals question. Does the GHC API have any
| hooks for being able to revert a CAF to the original expression, thus
| discarding the previously computed result?
|
| The reason I'm wanting this is that I have a particular CAF which
Can you use a weak pointer to do what you want?
If you keep a weak pointer to the head of your expensive list then
itwill be reclaimed at the next major GC I believe. I have used
weakpointers for vaugely similar purposes before.
I guess a downside is that they will always be reclaimed on GC even