[Haskell-cafe] Re: Efficient or predictable Ord for Typeable

Lennart Augustsson lennart at augustsson.net
Tue Nov 30 07:11:27 EST 2004


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


More information about the Haskell-Cafe mailing list