25 lines
508 B
Haskell
25 lines
508 B
Haskell
{-# OPTIONS_GHC -fno-warn-orphans #-}
|
|
|
|
module Data.Time.Calendar.Instances
|
|
(
|
|
) where
|
|
|
|
import ClassyPrelude
|
|
|
|
import Data.Time.Calendar
|
|
|
|
import Data.Universe
|
|
|
|
import Language.Haskell.TH.Syntax (Lift)
|
|
import Type.Reflection
|
|
|
|
|
|
deriving instance Lift Day
|
|
instance Hashable Day where
|
|
hashWithSalt s (ModifiedJulianDay jDay) = s `hashWithSalt` hash (typeRep @Day) `hashWithSalt` jDay
|
|
|
|
deriving instance Ord DayOfWeek
|
|
instance Universe DayOfWeek where
|
|
universe = [Monday .. Sunday]
|
|
instance Finite DayOfWeek
|