{-# OPTIONS_GHC -fno-warn-orphans #-}

module Data.Time.Clock.Instances
  (
  ) where

import ClassyPrelude

import Data.Time.Clock

import Data.Binary (Binary)
import qualified Data.Binary as Binary

import Data.Time.Calendar.Instances ()


instance Hashable DiffTime where
  hashWithSalt s = hashWithSalt s . toRational


deriving instance Generic UTCTime
instance Hashable UTCTime


instance Binary DiffTime where
  get = fromRational <$> Binary.get
  put = Binary.put . toRational
  
instance Binary UTCTime
