
On Thursday 29 December 2005 18:22, Christian Maeder wrote:
Einar Karttunen wrote:
On 22.12 14:43, Christian Maeder wrote:
How can I detect this sharing in order to avoid traversing the very same symbol table for every symbol?
By using System.Mem.StableName SerTH (http://cs.helsinki.fi/u/ekarttun/SerTH/) implements this, so you can look at the source for pointers.
Thanks for your hints. What a pity that "makeStableName" goes to IO (why would this break referential transparency?) and that "StableName a" and "TypeRep" have no Ord instances.
This has been asked before (by me too). The reason is that (due to efficient implementation issues) the order relation between TypeReps is not guaranteed to be the same for every program run. I guess the situation is similar with makeStableName, which is in the IO monad because the result may be different between program runs even given the same value as input. Ben