Commit 0b148490 authored by Simon Marlow's avatar Simon Marlow
Browse files

add eqStableName :: StableName a -> StableName b -> Bool

parent 833ba659
......@@ -37,6 +37,7 @@ module System.Mem.StableName (
StableName,
makeStableName,
hashStableName,
eqStableName
) where
import Prelude
......@@ -120,6 +121,16 @@ instance Eq (StableName a) where
_ -> True
#endif
-- | Equality on 'StableName' that does not require that the types of
-- the arguments match.
eqStableName :: StableName a -> StableName b -> Bool
eqStableName (StableName sn1) (StableName sn2) =
case eqStableName# sn1 sn2 of
0# -> False
_ -> True
-- Requested by Emil Axelsson on glasgow-haskell-users, who wants to
-- use it for implementing observable sharing.
#endif /* __GLASGOW_HASKELL__ */
#include "Typeable.h"
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment