Skip to content

Commit

Permalink
add Hashable1 instance
Browse files Browse the repository at this point in the history
  • Loading branch information
LightAndLight committed Apr 12, 2023
1 parent 87824c0 commit 7e546d2
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/Data/Vector/Instances.hs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ import Data.Semigroup
#ifdef MIN_VERSION_hashable
import Data.Hashable (Hashable(..))
#endif
#if MIN_VERSION_hashable(1,2,5)
import Data.Hashable.Lifted (Hashable1(..))
#endif
import Data.Key
import Data.Functor.Bind
import Data.Functor.Extend
Expand Down Expand Up @@ -150,3 +153,9 @@ instance (Primitive.Prim a, Hashable a) => Hashable (Primitive.Vector a) where
hashWithSalt salt = hashWithSalt salt . Primitive.toList
{-# INLINE hashWithSalt #-}
#endif

#if MIN_VERSION_hashable(1,2,5)
instance Hashable1 Vector where
liftHashWithSalt itemHashWithSalt salt = liftHashWithSalt itemHashWithSalt salt . Vector.toList
{-# INLINE liftHashWithSalt #-}
#endif

0 comments on commit 7e546d2

Please sign in to comment.