hashable-time 0.2.0.2 → 0.2.1
raw patch · 3 files changed
+35/−18 lines, 3 filesdep +time-compatdep ~basedep ~hashabledep ~timenew-uploaderPVP ok
version bump matches the API change (PVP)
Dependencies added: time-compat
Dependency ranges changed: base, hashable, time
API changes (from Hackage documentation)
+ Data.Hashable.Time: infixl 0 `hashWithSalt`
+ Data.Hashable.Time: instance Data.Hashable.Class.Hashable Data.Time.Calendar.Month.Compat.Month
+ Data.Hashable.Time: instance Data.Hashable.Class.Hashable Data.Time.Calendar.Quarter.Compat.Quarter
+ Data.Hashable.Time: instance Data.Hashable.Class.Hashable Data.Time.Calendar.Quarter.Compat.QuarterOfYear
+ Data.Hashable.Time: instance Data.Hashable.Class.Hashable Data.Time.Calendar.Week.DayOfWeek
Files
- changelog.md +6/−0
- hashable-time.cabal +7/−5
- src/Data/Hashable/Time.hs +22/−13
+ changelog.md view
@@ -0,0 +1,6 @@+0.2.1+-----++Add instances for `Month`, `Quarter`, `QuarterOfYear` and `DayOfWeek`.++
hashable-time.cabal view
@@ -1,5 +1,5 @@ name: hashable-time-version: 0.2.0.2+version: 0.2.1 synopsis: Hashable instances for Data.Time description: Hashable instances for types in Data.Time@@ -10,8 +10,8 @@ category: Data build-type: Simple cabal-version: >=1.10-extra-source-files: README.md-tested-with: GHC==7.8.4, GHC==7.10.3, GHC==8.0.2, GHC==8.2.2, GHC==8.4.3, GHC==8.6.1+extra-source-files: README.md changelog.md+tested-with: GHC==7.8.4, GHC==7.10.3, GHC==8.0.2, GHC==8.2.2, GHC==8.4.3, GHC==8.6.5, GHC==8.8.3, GHC==8.10.3 flag old-locale manual: False@@ -23,11 +23,13 @@ default-language: Haskell2010 ghc-options: -Wall other-extensions: CPP- build-depends: base >=4.7 && <4.13, hashable >=1.2.3.3 && <=1.3+ build-depends: base >=4.7 && <4.16, hashable >=1.2.4 && <1.4, time-compat >=1.9.4 && <1.10+ if flag(old-locale) build-depends: time >=1.4 && <1.5, old-locale >=1.0 && <1.1 else- build-depends: time >=1.5+ build-depends: time >=1.5 && <1.12+ source-repository head type: git
src/Data/Hashable/Time.hs view
@@ -7,21 +7,18 @@ -- Maintainer : Alexey Karakulov <ankarakulov@gmail.com> module Data.Hashable.Time (Hashable(..)) where -import Data.Fixed import Data.Hashable (Hashable(..))-import Data.Time--#if !MIN_VERSION_time(1,5,0)-import System.Locale-#endif---- Dependencies+import Data.Time.Compat (UniversalTime (..), DiffTime, UTCTime (..),+ NominalDiffTime, Day (..), DayOfWeek (..), TimeZone (..),+ TimeOfDay (..), LocalTime (..), ZonedTime (..))+import Data.Time.Calendar.Month.Compat (Month (..))+import Data.Time.Calendar.Quarter.Compat (Quarter (..), QuarterOfYear (..)) --- ! (>=1.2.4) ~ <1.2.4 ~ <= 1.2.3-#if !MIN_VERSION_hashable(1,2,4)--- https://github.com/tibbe/hashable/pull/101-instance Hashable (Fixed a) where- hashWithSalt salt (MkFixed i) = hashWithSalt salt i+-- time-compat doesn't redefine TimeLocale+#ifdef MIN_VERSION_old_locale+import System.Locale (TimeLocale (..))+#else+import Data.Time.Format.Compat (TimeLocale (..)) #endif -- Data.Time.Clock@@ -43,6 +40,18 @@ instance Hashable Day where hashWithSalt salt (ModifiedJulianDay d) = hashWithSalt salt d++instance Hashable Month where+ hashWithSalt salt (MkMonth x) = hashWithSalt salt x++instance Hashable Quarter where+ hashWithSalt salt (MkQuarter x) = hashWithSalt salt x++instance Hashable DayOfWeek where+ hashWithSalt salt = hashWithSalt salt . fromEnum++instance Hashable QuarterOfYear where+ hashWithSalt salt = hashWithSalt salt . fromEnum -- Data.Time.LocalTime