Giter Site home page Giter Site logo

Comments (6)

tibbe avatar tibbe commented on July 30, 2024

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.

hvr avatar hvr commented on July 30, 2024

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.

hvr avatar hvr commented on July 30, 2024

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.

hvr avatar hvr commented on July 30, 2024

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.

bos avatar bos commented on July 30, 2024

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.

tibbe avatar tibbe commented on July 30, 2024

Lets close this for now.

from hashable.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.