-
Notifications
You must be signed in to change notification settings - Fork 65
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make Async a
Hashable
#73
Comments
Yes! |
I'm not too excited about this change for
While I understand the virtue of this change, it also induces a cost on every user of How I see it, this is a trade of between cost and functionality. Making a decision either way is valid. I just wanted to voice my preference here, which is not adding the additional dependencies and keeping |
Yeah, I do realise that it is somewhat of a compromise, that’s why I started by asking whether Simon considers adding a dependency on And I agree that some users may see this as an additional cost they did not ask for. But, on the other hand, I believe that any non-trivial Haskell project is very likely to depend on In the end it should be your decision. Another option (rather weird one, but probably easier on the users) would be to have a separate library (e.g. |
The alternative is to have |
It does not :( Build-depends: base >= 4.4 && < 4.11,
bytestring >= 0.9 && < 0.11,
deepseq >= 1.3
if impl(ghc)
Build-depends: ghc-prim,
text >= 0.11.0.5
if impl(ghc) && flag(integer-gmp)
Build-depends: integer-gmp >= 0.2 We can ask what they think nevertheless, but I suspect they won’t be too excited about a transitive dependency on |
You could add it as an optionally built module + dep via cabal flag?
…On Jan 8, 2018 1:07 AM, "Kirill Elagin" ***@***.***> wrote:
if hashable already has a large set of dependencies
It does not :(
Build-depends: base >= 4.4 && < 4.11,
bytestring >= 0.9 && < 0.11,
deepseq >= 1.3
if impl(ghc)
Build-depends: ghc-prim,
text >= 0.11.0.5
if impl(ghc) && flag(integer-gmp)
Build-depends: integer-gmp >= 0.2
We can ask what they think nevertheless, but I suspect they won’t be too
excited about a transitive dependency on stm either.
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
<#73 (comment)>, or mute
the thread
<https://github.com/notifications/unsubscribe-auth/AABwJ--fj0EIovZUNtpdbHUMFtdYnLovks5tIdrggaJpZM4RHqPT>
.
|
No, that's even worse. Packages should have a stable API. How would you express a dependency on the version of async with the flag enabled? FWIW, GHC will have a dependency on |
For |
Async a
already has instances ofEq
andOrd
, which makes it possible to store it in aSet
, but it has no instance ofHashable
, so it is not possible to store it in aHashSet
, while the idea of having aHashSet
of running threads seems to be quite useful.Given that
ThreadId
already has an instance ofHashable
andEq
andOrd
ofAsync a
delegate to the internalThreadId
, providing such an instance would be trivial, although it would require depending onhashable
.If this is acceptable, I can prepare a PR.
The text was updated successfully, but these errors were encountered: