Skip to content

Commit

Permalink
Merge pull request #129 from phadej/lifted-exports
Browse files Browse the repository at this point in the history
Export Hashable1 and Hashable2
  • Loading branch information
tibbe committed Jan 3, 2017
2 parents 0c90da3 + 2d00fec commit 2dfc25e
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 4 deletions.
4 changes: 4 additions & 0 deletions CHANGES.md
@@ -1,3 +1,7 @@
## Version 1.2.6.0

* Export `Hashable1` and `Hashable2`

## Version 1.2.5.0

* Add `Hashable1` and `Hashable2`
Expand Down
7 changes: 6 additions & 1 deletion Data/Hashable.hs
Expand Up @@ -36,7 +36,8 @@ module Data.Hashable

-- * Computing hash values
Hashable(..)

, Hashable1(..)
, Hashable2(..)
-- * Creating new instances
-- | There are two ways to create new instances: by deriving
-- instances automatically using GHC's generic programming
Expand Down Expand Up @@ -64,6 +65,10 @@ module Data.Hashable
, hashByteArray
, hashByteArrayWithSalt
#endif
-- * Higher Rank Functions
, hashWithSalt1
, hashWithSalt2
, defaultLiftHashWithSalt
-- * Caching hashes
, Hashed
, hashed
Expand Down
3 changes: 1 addition & 2 deletions Data/Hashable/Class.hs
Expand Up @@ -267,11 +267,10 @@ hashWithSalt2 = liftHashWithSalt2 hashWithSalt hashWithSalt
defaultLiftHashWithSalt :: (Hashable2 f, Hashable a) => (Int -> b -> Int) -> Int -> f a b -> Int
defaultLiftHashWithSalt h = liftHashWithSalt2 hashWithSalt h

-- Since we support a generic implementation of 'hashWithSalt' we
-- | Since we support a generic implementation of 'hashWithSalt' we
-- cannot also provide a default implementation for that method for
-- the non-generic instance use case. Instead we provide
-- 'defaultHashWith'.

defaultHashWithSalt :: Hashable a => Int -> a -> Int
defaultHashWithSalt salt x = salt `combine` hash x

Expand Down
2 changes: 1 addition & 1 deletion hashable.cabal
@@ -1,5 +1,5 @@
Name: hashable
Version: 1.2.5.0
Version: 1.2.6.0
Synopsis: A class for types that can be converted to a hash value
Description: This package defines a class, 'Hashable', for types that
can be converted to a hash value. This class
Expand Down

0 comments on commit 2dfc25e

Please sign in to comment.