30 Nov
2004
30 Nov
'04
7:11 a.m.
George Russell wrote:
Simon Peyton-Jones wrote:
The trouble is that *any* "function" can now deliver unpredictable results. Can I rely on the fact that foo :: Int -> Int will always give the same answer given the same input. Not any more.
Yes, I see what you mean.
I think the strongest argument here is that it's like a more benign version of unsafePerformIO, whose existence also threatens foo's predictability.
I suggest you implement
hashTypeable :: Typeable -> IO Int32
And/or mkHashTypeable :: IO (Typeable -> Int32) -- Lennart