#913: instance Ord (StableName a)
-----------------------------+----------------------------------------------
Reporter: ekarttun | Owner:
Type: feature request | Status: new
Priority: normal | Milestone: 6.8
Component: libraries/base | Version: 6.4.2
Severity: normal | Resolution:
Keywords: | Difficulty: Easy (1 hr)
Testcase: | Architecture: Unknown
Os: Unknown |
-----------------------------+----------------------------------------------
Changes (by simonmar):
* milestone: => 6.8
* testcase: =>
Comment:
I think this is possible. hashStableName says that it doesn't guarantee
to be unique, but I think that's only because StableName identifiers can
be reused. There is a danger that one of the SNs might get GC'd just
after we call stableNameToInt# on it and the identity could be reused by
newStableName in another thread, but the original comparison would still
be valid. Conclusion: just call stableNameToInt# on the two stable names
and compare the Int#s.
--
Ticket URL: <http://hackage.haskell.org/trac/ghc/ticket/913>
GHC <http://www.haskell.org/ghc/>
The Glasgow Haskell Compiler
_______________________________________________
Glasgow-haskell-bugs mailing list
Glasgow-haskell-bugs@haskell.org
http://www.haskell.org/mailman/listinfo/glasgow-haskell-bugs