Comparing StableNames of different type

Nicolas Frisby nicolas.frisby at gmail.com
Tue Aug 28 18:08:24 CEST 2012


On Tue, Aug 28, 2012 at 3:34 AM, Simon Marlow <marlowsd at gmail.com> wrote:
>>>> On 24/08/2012 07:39, Emil Axelsson wrote:
>>>>>
>>>>> Are there any dangers in comparing two StableNames of different type?
>>>>>
>>>>>    stEq :: StableName a -> StableName b -> Bool
>>>>>    stEq a b = a == (unsafeCoerce b)
>>>>
> Ok, I've added it.  It will be in GHC 7.8.1.
>
> Cheers,
>         Simon

Might we benefit from having a variant that returns Maybe (a :=: b)?
Is that safe? I have limited experience with StableNames, but that
intuitively seems safe. But polymorphism and references deserve more
thought than I've given this yet.

I'm referring to "data (:=:) :: * -> * -> * where Refl :: (a :=: a)",
just to be clear.



More information about the Glasgow-haskell-users mailing list