hashable-time-0.2.0.2: Hashable instances for Data.Time
LicenseBSD3
MaintainerAlexey Karakulov <ankarakulov@gmail.com>
Safe HaskellSafe
LanguageHaskell2010

Data.Hashable.Time

Description

 
Synopsis

Documentation

class Hashable a where Source #

The class of types that can be converted to a hash value.

Minimal implementation: hashWithSalt.

Minimal complete definition

Nothing

Methods

hashWithSalt :: Int -> a -> Int infixl 0 Source #

Return a hash value for the argument, using the given salt.

The general contract of hashWithSalt is:

  • If two values are equal according to the == method, then applying the hashWithSalt method on each of the two values must produce the same integer result if the same salt is used in each case.
  • It is not required that if two values are unequal according to the == method, then applying the hashWithSalt method on each of the two values must produce distinct integer results. However, the programmer should be aware that producing distinct integer results for unequal values may improve the performance of hashing-based data structures.
  • This method can be used to compute different hash values for the same input by providing a different salt in each application of the method. This implies that any instance that defines hashWithSalt must make use of the salt in its implementation.

hash :: a -> Int Source #

Like hashWithSalt, but no salt is used. The default implementation uses hashWithSalt with some default salt. Instances might want to implement this method to provide a more efficient implementation than the default implementation.

Instances

Instances details
Hashable Bool 
Instance details

Defined in Data.Hashable.Class

Methods

hashWithSalt :: Int -> Bool -> Int Source #

hash :: Bool -> Int Source #

Hashable Char 
Instance details

Defined in Data.Hashable.Class

Methods

hashWithSalt :: Int -> Char -> Int Source #

hash :: Char -> Int Source #

Hashable Double

Note: prior to hashable-1.3.0.0, hash 0.0 /= hash (-0.0)

The hash of NaN is not well defined.

Since: hashable-1.3.0.0

Instance details

Defined in Data.Hashable.Class

Methods

hashWithSalt :: Int -> Double -> Int Source #

hash :: Double -> Int Source #

Hashable Float

Note: prior to hashable-1.3.0.0, hash 0.0 /= hash (-0.0)

The hash of NaN is not well defined.

Since: hashable-1.3.0.0

Instance details

Defined in Data.Hashable.Class

Methods

hashWithSalt :: Int -> Float -> Int Source #

hash :: Float -> Int Source #

Hashable Int 
Instance details

Defined in Data.Hashable.Class

Methods

hashWithSalt :: Int -> Int -> Int Source #

hash :: Int -> Int Source #

Hashable Int8 
Instance details

Defined in Data.Hashable.Class

Methods

hashWithSalt :: Int -> Int8 -> Int Source #

hash :: Int8 -> Int Source #

Hashable Int16 
Instance details

Defined in Data.Hashable.Class

Methods

hashWithSalt :: Int -> Int16 -> Int Source #

hash :: Int16 -> Int Source #

Hashable Int32 
Instance details

Defined in Data.Hashable.Class

Methods

hashWithSalt :: Int -> Int32 -> Int Source #

hash :: Int32 -> Int Source #

Hashable Int64 
Instance details

Defined in Data.Hashable.Class

Methods

hashWithSalt :: Int -> Int64 -> Int Source #

hash :: Int64 -> Int Source #

Hashable Integer 
Instance details

Defined in Data.Hashable.Class

Methods

hashWithSalt :: Int -> Integer -> Int Source #

hash :: Integer -> Int Source #

Hashable Natural 
Instance details

Defined in Data.Hashable.Class

Methods

hashWithSalt :: Int -> Natural -> Int Source #

hash :: Natural -> Int Source #

Hashable Ordering 
Instance details

Defined in Data.Hashable.Class

Methods

hashWithSalt :: Int -> Ordering -> Int Source #

hash :: Ordering -> Int Source #

Hashable Word 
Instance details

Defined in Data.Hashable.Class

Methods

hashWithSalt :: Int -> Word -> Int Source #

hash :: Word -> Int Source #

Hashable Word8 
Instance details

Defined in Data.Hashable.Class

Methods

hashWithSalt :: Int -> Word8 -> Int Source #

hash :: Word8 -> Int Source #

Hashable Word16 
Instance details

Defined in Data.Hashable.Class

Methods

hashWithSalt :: Int -> Word16 -> Int Source #

hash :: Word16 -> Int Source #

Hashable Word32 
Instance details

Defined in Data.Hashable.Class

Methods

hashWithSalt :: Int -> Word32 -> Int Source #

hash :: Word32 -> Int Source #

Hashable Word64 
Instance details

Defined in Data.Hashable.Class

Methods

hashWithSalt :: Int -> Word64 -> Int Source #

hash :: Word64 -> Int Source #

Hashable SomeTypeRep 
Instance details

Defined in Data.Hashable.Class

Methods

hashWithSalt :: Int -> SomeTypeRep -> Int Source #

hash :: SomeTypeRep -> Int Source #

Hashable () 
Instance details

Defined in Data.Hashable.Class

Methods

hashWithSalt :: Int -> () -> Int Source #

hash :: () -> Int Source #

Hashable Day Source # 
Instance details

Defined in Data.Hashable.Time

Methods

hashWithSalt :: Int -> Day -> Int Source #

hash :: Day -> Int Source #

Hashable DiffTime Source # 
Instance details

Defined in Data.Hashable.Time

Methods

hashWithSalt :: Int -> DiffTime -> Int Source #

hash :: DiffTime -> Int Source #

Hashable NominalDiffTime Source # 
Instance details

Defined in Data.Hashable.Time

Methods

hashWithSalt :: Int -> NominalDiffTime -> Int Source #

hash :: NominalDiffTime -> Int Source #

Hashable UTCTime Source # 
Instance details

Defined in Data.Hashable.Time

Methods

hashWithSalt :: Int -> UTCTime -> Int Source #

hash :: UTCTime -> Int Source #

Hashable UniversalTime Source # 
Instance details

Defined in Data.Hashable.Time

Methods

hashWithSalt :: Int -> UniversalTime -> Int Source #

hash :: UniversalTime -> Int Source #

Hashable TimeLocale Source # 
Instance details

Defined in Data.Hashable.Time

Methods

hashWithSalt :: Int -> TimeLocale -> Int Source #

hash :: TimeLocale -> Int Source #

Hashable LocalTime Source # 
Instance details

Defined in Data.Hashable.Time

Methods

hashWithSalt :: Int -> LocalTime -> Int Source #

hash :: LocalTime -> Int Source #

Hashable TimeOfDay Source # 
Instance details

Defined in Data.Hashable.Time

Methods

hashWithSalt :: Int -> TimeOfDay -> Int Source #

hash :: TimeOfDay -> Int Source #

Hashable TimeZone Source # 
Instance details

Defined in Data.Hashable.Time

Methods

hashWithSalt :: Int -> TimeZone -> Int Source #

hash :: TimeZone -> Int Source #

Hashable ZonedTime Source # 
Instance details

Defined in Data.Hashable.Time

Methods

hashWithSalt :: Int -> ZonedTime -> Int Source #

hash :: ZonedTime -> Int Source #

Hashable Text 
Instance details

Defined in Data.Hashable.Class

Methods

hashWithSalt :: Int -> Text -> Int Source #

hash :: Text -> Int Source #

Hashable ByteString 
Instance details

Defined in Data.Hashable.Class

Methods

hashWithSalt :: Int -> ByteString -> Int Source #

hash :: ByteString -> Int Source #

Hashable ByteString 
Instance details

Defined in Data.Hashable.Class

Methods

hashWithSalt :: Int -> ByteString -> Int Source #

hash :: ByteString -> Int Source #

Hashable Text 
Instance details

Defined in Data.Hashable.Class

Methods

hashWithSalt :: Int -> Text -> Int Source #

hash :: Text -> Int Source #

Hashable BigNat 
Instance details

Defined in Data.Hashable.Class

Methods

hashWithSalt :: Int -> BigNat -> Int Source #

hash :: BigNat -> Int Source #

Hashable Fingerprint

Since: hashable-1.3.0.0

Instance details

Defined in Data.Hashable.Class

Methods

hashWithSalt :: Int -> Fingerprint -> Int Source #

hash :: Fingerprint -> Int Source #

Hashable IntPtr 
Instance details

Defined in Data.Hashable.Class

Methods

hashWithSalt :: Int -> IntPtr -> Int Source #

hash :: IntPtr -> Int Source #

Hashable ShortByteString 
Instance details

Defined in Data.Hashable.Class

Methods

hashWithSalt :: Int -> ShortByteString -> Int Source #

hash :: ShortByteString -> Int Source #

Hashable ThreadId 
Instance details

Defined in Data.Hashable.Class

Methods

hashWithSalt :: Int -> ThreadId -> Int Source #

hash :: ThreadId -> Int Source #

Hashable Unique 
Instance details

Defined in Data.Hashable.Class

Methods

hashWithSalt :: Int -> Unique -> Int Source #

hash :: Unique -> Int Source #

Hashable Version 
Instance details

Defined in Data.Hashable.Class

Methods

hashWithSalt :: Int -> Version -> Int Source #

hash :: Version -> Int Source #

Hashable Void 
Instance details

Defined in Data.Hashable.Class

Methods

hashWithSalt :: Int -> Void -> Int Source #

hash :: Void -> Int Source #

Hashable WordPtr 
Instance details

Defined in Data.Hashable.Class

Methods

hashWithSalt :: Int -> WordPtr -> Int Source #

hash :: WordPtr -> Int Source #

Hashable a => Hashable [a] 
Instance details

Defined in Data.Hashable.Class

Methods

hashWithSalt :: Int -> [a] -> Int Source #

hash :: [a] -> Int Source #

Hashable a => Hashable (Maybe a) 
Instance details

Defined in Data.Hashable.Class

Methods

hashWithSalt :: Int -> Maybe a -> Int Source #

hash :: Maybe a -> Int Source #

Hashable a => Hashable (Ratio a) 
Instance details

Defined in Data.Hashable.Class

Methods

hashWithSalt :: Int -> Ratio a -> Int Source #

hash :: Ratio a -> Int Source #

Hashable (Ptr a) 
Instance details

Defined in Data.Hashable.Class

Methods

hashWithSalt :: Int -> Ptr a -> Int Source #

hash :: Ptr a -> Int Source #

Hashable (FunPtr a) 
Instance details

Defined in Data.Hashable.Class

Methods

hashWithSalt :: Int -> FunPtr a -> Int Source #

hash :: FunPtr a -> Int Source #

Hashable (Hashed a) 
Instance details

Defined in Data.Hashable.Class

Methods

hashWithSalt :: Int -> Hashed a -> Int Source #

hash :: Hashed a -> Int Source #

Hashable (Fixed a) 
Instance details

Defined in Data.Hashable.Class

Methods

hashWithSalt :: Int -> Fixed a -> Int Source #

hash :: Fixed a -> Int Source #

Hashable a => Hashable (NonEmpty a) 
Instance details

Defined in Data.Hashable.Class

Methods

hashWithSalt :: Int -> NonEmpty a -> Int Source #

hash :: NonEmpty a -> Int Source #

Hashable a => Hashable (Identity a) 
Instance details

Defined in Data.Hashable.Class

Methods

hashWithSalt :: Int -> Identity a -> Int Source #

hash :: Identity a -> Int Source #

Hashable a => Hashable (Complex a) 
Instance details

Defined in Data.Hashable.Class

Methods

hashWithSalt :: Int -> Complex a -> Int Source #

hash :: Complex a -> Int Source #

Hashable a => Hashable (First a) 
Instance details

Defined in Data.Hashable.Class

Methods

hashWithSalt :: Int -> First a -> Int Source #

hash :: First a -> Int Source #

Hashable a => Hashable (Last a) 
Instance details

Defined in Data.Hashable.Class

Methods

hashWithSalt :: Int -> Last a -> Int Source #

hash :: Last a -> Int Source #

Hashable a => Hashable (Max a) 
Instance details

Defined in Data.Hashable.Class

Methods

hashWithSalt :: Int -> Max a -> Int Source #

hash :: Max a -> Int Source #

Hashable a => Hashable (Min a) 
Instance details

Defined in Data.Hashable.Class

Methods

hashWithSalt :: Int -> Min a -> Int Source #

hash :: Min a -> Int Source #

Hashable a => Hashable (Option a) 
Instance details

Defined in Data.Hashable.Class

Methods

hashWithSalt :: Int -> Option a -> Int Source #

hash :: Option a -> Int Source #

Hashable (StableName a) 
Instance details

Defined in Data.Hashable.Class

Methods

hashWithSalt :: Int -> StableName a -> Int Source #

hash :: StableName a -> Int Source #

Hashable a => Hashable (WrappedMonoid a) 
Instance details

Defined in Data.Hashable.Class

Methods

hashWithSalt :: Int -> WrappedMonoid a -> Int Source #

hash :: WrappedMonoid a -> Int Source #

(Hashable a, Hashable b) => Hashable (Either a b) 
Instance details

Defined in Data.Hashable.Class

Methods

hashWithSalt :: Int -> Either a b -> Int Source #

hash :: Either a b -> Int Source #

Hashable (TypeRep a) 
Instance details

Defined in Data.Hashable.Class

Methods

hashWithSalt :: Int -> TypeRep a -> Int Source #

hash :: TypeRep a -> Int Source #

(Hashable a1, Hashable a2) => Hashable (a1, a2) 
Instance details

Defined in Data.Hashable.Class

Methods

hashWithSalt :: Int -> (a1, a2) -> Int Source #

hash :: (a1, a2) -> Int Source #

Hashable a => Hashable (Arg a b)

Note: Prior to hashable-1.3.0.0 the hash computation included the second argument of Arg which wasn't consistent with its Eq instance.

Since: hashable-1.3.0.0

Instance details

Defined in Data.Hashable.Class

Methods

hashWithSalt :: Int -> Arg a b -> Int Source #

hash :: Arg a b -> Int Source #

Hashable (Proxy a) 
Instance details

Defined in Data.Hashable.Class

Methods

hashWithSalt :: Int -> Proxy a -> Int Source #

hash :: Proxy a -> Int Source #

(Hashable a1, Hashable a2, Hashable a3) => Hashable (a1, a2, a3) 
Instance details

Defined in Data.Hashable.Class

Methods

hashWithSalt :: Int -> (a1, a2, a3) -> Int Source #

hash :: (a1, a2, a3) -> Int Source #

Hashable a => Hashable (Const a b) 
Instance details

Defined in Data.Hashable.Class

Methods

hashWithSalt :: Int -> Const a b -> Int Source #

hash :: Const a b -> Int Source #

(Hashable a1, Hashable a2, Hashable a3, Hashable a4) => Hashable (a1, a2, a3, a4) 
Instance details

Defined in Data.Hashable.Class

Methods

hashWithSalt :: Int -> (a1, a2, a3, a4) -> Int Source #

hash :: (a1, a2, a3, a4) -> Int Source #

(Hashable1 f, Hashable1 g, Hashable a) => Hashable (Product f g a) 
Instance details

Defined in Data.Hashable.Class

Methods

hashWithSalt :: Int -> Product f g a -> Int Source #

hash :: Product f g a -> Int Source #

(Hashable1 f, Hashable1 g, Hashable a) => Hashable (Sum f g a) 
Instance details

Defined in Data.Hashable.Class

Methods

hashWithSalt :: Int -> Sum f g a -> Int Source #

hash :: Sum f g a -> Int Source #

(Hashable a1, Hashable a2, Hashable a3, Hashable a4, Hashable a5) => Hashable (a1, a2, a3, a4, a5) 
Instance details

Defined in Data.Hashable.Class

Methods

hashWithSalt :: Int -> (a1, a2, a3, a4, a5) -> Int Source #

hash :: (a1, a2, a3, a4, a5) -> Int Source #

(Hashable1 f, Hashable1 g, Hashable a) => Hashable (Compose f g a)

In general, hash (Compose x) ≠ hash x. However, hashWithSalt satisfies its variant of this equivalence.

Instance details

Defined in Data.Hashable.Class

Methods

hashWithSalt :: Int -> Compose f g a -> Int Source #

hash :: Compose f g a -> Int Source #

(Hashable a1, Hashable a2, Hashable a3, Hashable a4, Hashable a5, Hashable a6) => Hashable (a1, a2, a3, a4, a5, a6) 
Instance details

Defined in Data.Hashable.Class

Methods

hashWithSalt :: Int -> (a1, a2, a3, a4, a5, a6) -> Int Source #

hash :: (a1, a2, a3, a4, a5, a6) -> Int Source #

(Hashable a1, Hashable a2, Hashable a3, Hashable a4, Hashable a5, Hashable a6, Hashable a7) => Hashable (a1, a2, a3, a4, a5, a6, a7) 
Instance details

Defined in Data.Hashable.Class

Methods

hashWithSalt :: Int -> (a1, a2, a3, a4, a5, a6, a7) -> Int Source #

hash :: (a1, a2, a3, a4, a5, a6, a7) -> Int Source #

Orphan instances

Hashable Day Source # 
Instance details

Methods

hashWithSalt :: Int -> Day -> Int Source #

hash :: Day -> Int Source #

Hashable DiffTime Source # 
Instance details

Methods

hashWithSalt :: Int -> DiffTime -> Int Source #

hash :: DiffTime -> Int Source #

Hashable NominalDiffTime Source # 
Instance details

Methods

hashWithSalt :: Int -> NominalDiffTime -> Int Source #

hash :: NominalDiffTime -> Int Source #

Hashable UTCTime Source # 
Instance details

Methods

hashWithSalt :: Int -> UTCTime -> Int Source #

hash :: UTCTime -> Int Source #

Hashable UniversalTime Source # 
Instance details

Methods

hashWithSalt :: Int -> UniversalTime -> Int Source #

hash :: UniversalTime -> Int Source #

Hashable TimeLocale Source # 
Instance details

Methods

hashWithSalt :: Int -> TimeLocale -> Int Source #

hash :: TimeLocale -> Int Source #

Hashable LocalTime Source # 
Instance details

Methods

hashWithSalt :: Int -> LocalTime -> Int Source #

hash :: LocalTime -> Int Source #

Hashable TimeOfDay Source # 
Instance details

Methods

hashWithSalt :: Int -> TimeOfDay -> Int Source #

hash :: TimeOfDay -> Int Source #

Hashable TimeZone Source # 
Instance details

Methods

hashWithSalt :: Int -> TimeZone -> Int Source #

hash :: TimeZone -> Int Source #

Hashable ZonedTime Source # 
Instance details

Methods

hashWithSalt :: Int -> ZonedTime -> Int Source #

hash :: ZonedTime -> Int Source #