Comments (6)
I'm not opposed to the type alias. However, a newtype is quite inconvenient as you typically want to perform bitwise operations on a hash. Also, you better know if the value is signed or not when you operator on it.
from hashable.
fwiw, you could still expose the interesting type-classes by GeneralizedNewtypeDeriving...
(btw, wouldn't an unsigned Word
integer be a better fit for hash-values and bit-operations?)
from hashable.
I'd like to revisit this issue:
However, a newtype is quite inconvenient as you typically want to perform bitwise operations on a hash
...wouldn't providing a newtype
with a Bits
instance address this concern?
from hashable.
just a crazy idea: if Hash
was a type, one could define a Monoid
over it... where mappend = Data.Hashable.combine
... :-))
PS: I just saw Brent Yorgey's haskell symposium talk about monoids...
from hashable.
I'm chilly at best on this idea. I just killed combine
off from the API as a not-awesome idea. If anything, it's the salt that needs a helpful type synonym, not the hash, but even that seems like it's not worthwhile since the types are just not confusing.
from hashable.
Lets close this for now.
from hashable.
Related Issues (20)
- Add instances for type(s) in Data.Array.Byte (base-4.17)
- Add instances for new types in `filepath`
- Support GHC 9.4 HOT 1
- Allow GHC-9.4? HOT 2
- Unable to compile on Mac M1 architecture HOT 2
- What's the deal with Fixed? HOT 1
- Hash unstable across executions HOT 6
- hashable doesn't compile in ghc 9.6.1-alpha3 HOT 1
- Hashable 1.4.2.0 fails to build on integer-simple GHC HOT 2
- better instance Hashable IntSet? HOT 5
- ( odd x && odd y) ==> hash (x,y) == hash (negate x, negate y ) HOT 10
- using Hashed inside a tuple produces collisions HOT 4
- Caching hash value sometimes leads to equal hashes for different inputs HOT 1
- Minor release 1.4.3.0 introduces semantic changes HOT 1
- Use fromThreadId HOT 1
- Allow containers-0.7 HOT 2
- GHC99 failed to build: perhaps need to add ‘os-string’ to the build-depends HOT 2
- hashable doesn't support filepath-1.5, ghc-9.10 will bump filepath to 1.5 HOT 3
- Could AES-NI instructions be used for better Int hashes? HOT 1
- Could AES-NI instructions be used for better Int hashes? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hashable.