Comparing StableNames of different type

Emil Axelsson emax at chalmers.se
Fri Aug 24 11:39:32 CEST 2012


2012-08-24 11:18, Emil Axelsson skrev:
> 2012-08-24 11:08, Simon Marlow skrev:
>> On 24/08/2012 07:39, Emil Axelsson wrote:
>>> Hi!
>>>
>>> Are there any dangers in comparing two StableNames of different type?
>>>
>>>    stEq :: StableName a -> StableName b -> Bool
>>>    stEq a b = a == (unsafeCoerce b)
>>>
>>> I could guard the coercion by first comparing the type representations,
>>> but that would give me a `Typeable` constraint that would spread
>>> throughout the code.
>>
>> I think that's probably OK.
>
> OK, good! How about putting this function in the library so that people
> don't have to hack it up themselves?

Oops, I did not intend to sound suggestive :) I was more wondering if 
people think it would be a good idea. If so, I can make a proposal.

/ Emil



More information about the Glasgow-haskell-users mailing list