    {-# LANGUAGE Safe #-}

    module Data.Time.Clock.Internal.UTCTime where

    import Control.DeepSeq
    import Data.Data
    import Data.Time.Calendar.Days
    import Data.Time.Clock.Internal.DiffTime
    import GHC.Generics
    import Language.Haskell.TH.Syntax qualified as TH

    -- | This is the simplest representation of UTC.
    -- It consists of the day number, and a time offset from midnight.
    -- Note that if a day has a leap second added to it, it will have 86401 seconds.
    data UTCTime = UTCTime
        { UTCTime -> Day
    utctDay :: Day
        -- ^ the day
        , UTCTime -> DiffTime
    utctDayTime :: DiffTime
        -- ^ the time from midnight, 0 <= t < 86401s (because of leap-seconds)
        }
        deriving (UTCTime -> UTCTime -> Bool
    (UTCTime -> UTCTime -> Bool)
    -> (UTCTime -> UTCTime -> Bool) -> Eq UTCTime
    forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
    $c== :: UTCTime -> UTCTime -> Bool
    == :: UTCTime -> UTCTime -> Bool
    $c/= :: UTCTime -> UTCTime -> Bool
    /= :: UTCTime -> UTCTime -> Bool
    Eq, Eq UTCTime
    Eq UTCTime =>
    (UTCTime -> UTCTime -> Ordering)
    -> (UTCTime -> UTCTime -> Bool)
    -> (UTCTime -> UTCTime -> Bool)
    -> (UTCTime -> UTCTime -> Bool)
    -> (UTCTime -> UTCTime -> Bool)
    -> (UTCTime -> UTCTime -> UTCTime)
    -> (UTCTime -> UTCTime -> UTCTime)
    -> Ord UTCTime
    UTCTime -> UTCTime -> Bool
    UTCTime -> UTCTime -> Ordering
    UTCTime -> UTCTime -> UTCTime
    forall a.
    Eq a =>
    (a -> a -> Ordering)
    -> (a -> a -> Bool)
    -> (a -> a -> Bool)
    -> (a -> a -> Bool)
    -> (a -> a -> Bool)
    -> (a -> a -> a)
    -> (a -> a -> a)
    -> Ord a
    $ccompare :: UTCTime -> UTCTime -> Ordering
    compare :: UTCTime -> UTCTime -> Ordering
    $c< :: UTCTime -> UTCTime -> Bool
    < :: UTCTime -> UTCTime -> Bool
    $c<= :: UTCTime -> UTCTime -> Bool
    <= :: UTCTime -> UTCTime -> Bool
    $c> :: UTCTime -> UTCTime -> Bool
    > :: UTCTime -> UTCTime -> Bool
    $c>= :: UTCTime -> UTCTime -> Bool
    >= :: UTCTime -> UTCTime -> Bool
    $cmax :: UTCTime -> UTCTime -> UTCTime
    max :: UTCTime -> UTCTime -> UTCTime
    $cmin :: UTCTime -> UTCTime -> UTCTime
    min :: UTCTime -> UTCTime -> UTCTime
    Ord, Typeable, Typeable UTCTime
    Typeable UTCTime =>
    (forall (c :: * -> *).
     (forall d b. Data d => c (d -> b) -> d -> c b)
     -> (forall g. g -> c g) -> UTCTime -> c UTCTime)
    -> (forall (c :: * -> *).
        (forall b r. Data b => c (b -> r) -> c r)
        -> (forall r. r -> c r) -> Constr -> c UTCTime)
    -> (UTCTime -> Constr)
    -> (UTCTime -> DataType)
    -> (forall (t :: * -> *) (c :: * -> *).
        Typeable t =>
        (forall d. Data d => c (t d)) -> Maybe (c UTCTime))
    -> (forall (t :: * -> * -> *) (c :: * -> *).
        Typeable t =>
        (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c UTCTime))
    -> ((forall b. Data b => b -> b) -> UTCTime -> UTCTime)
    -> (forall r r'.
        (r -> r' -> r)
        -> r -> (forall d. Data d => d -> r') -> UTCTime -> r)
    -> (forall r r'.
        (r' -> r -> r)
        -> r -> (forall d. Data d => d -> r') -> UTCTime -> r)
    -> (forall u. (forall d. Data d => d -> u) -> UTCTime -> [u])
    -> (forall u. Int -> (forall d. Data d => d -> u) -> UTCTime -> u)
    -> (forall (m :: * -> *).
        Monad m =>
        (forall d. Data d => d -> m d) -> UTCTime -> m UTCTime)
    -> (forall (m :: * -> *).
        MonadPlus m =>
        (forall d. Data d => d -> m d) -> UTCTime -> m UTCTime)
    -> (forall (m :: * -> *).
        MonadPlus m =>
        (forall d. Data d => d -> m d) -> UTCTime -> m UTCTime)
    -> Data UTCTime
    UTCTime -> Constr
    UTCTime -> DataType
    (forall b. Data b => b -> b) -> UTCTime -> UTCTime
    forall a.
    Typeable a =>
    (forall (c :: * -> *).
     (forall d b. Data d => c (d -> b) -> d -> c b)
     -> (forall g. g -> c g) -> a -> c a)
    -> (forall (c :: * -> *).
        (forall b r. Data b => c (b -> r) -> c r)
        -> (forall r. r -> c r) -> Constr -> c a)
    -> (a -> Constr)
    -> (a -> DataType)
    -> (forall (t :: * -> *) (c :: * -> *).
        Typeable t =>
        (forall d. Data d => c (t d)) -> Maybe (c a))
    -> (forall (t :: * -> * -> *) (c :: * -> *).
        Typeable t =>
        (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c a))
    -> ((forall b. Data b => b -> b) -> a -> a)
    -> (forall r r'.
        (r -> r' -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
    -> (forall r r'.
        (r' -> r -> r) -> r -> (forall d. Data d => d -> r') -> a -> r)
    -> (forall u. (forall d. Data d => d -> u) -> a -> [u])
    -> (forall u. Int -> (forall d. Data d => d -> u) -> a -> u)
    -> (forall (m :: * -> *).
        Monad m =>
        (forall d. Data d => d -> m d) -> a -> m a)
    -> (forall (m :: * -> *).
        MonadPlus m =>
        (forall d. Data d => d -> m d) -> a -> m a)
    -> (forall (m :: * -> *).
        MonadPlus m =>
        (forall d. Data d => d -> m d) -> a -> m a)
    -> Data a
    forall u. Int -> (forall d. Data d => d -> u) -> UTCTime -> u
    forall u. (forall d. Data d => d -> u) -> UTCTime -> [u]
    forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> UTCTime -> r
    forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> UTCTime -> r
    forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> UTCTime -> m UTCTime
    forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> UTCTime -> m UTCTime
    forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c UTCTime
    forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> UTCTime -> c UTCTime
    forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c UTCTime)
    forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c UTCTime)
    $cgfoldl :: forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> UTCTime -> c UTCTime
    gfoldl :: forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> UTCTime -> c UTCTime
    $cgunfold :: forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c UTCTime
    gunfold :: forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c UTCTime
    $ctoConstr :: UTCTime -> Constr
    toConstr :: UTCTime -> Constr
    $cdataTypeOf :: UTCTime -> DataType
    dataTypeOf :: UTCTime -> DataType
    $cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c UTCTime)
    dataCast1 :: forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c UTCTime)
    $cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c UTCTime)
    dataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e)) -> Maybe (c UTCTime)
    $cgmapT :: (forall b. Data b => b -> b) -> UTCTime -> UTCTime
    gmapT :: (forall b. Data b => b -> b) -> UTCTime -> UTCTime
    $cgmapQl :: forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> UTCTime -> r
    gmapQl :: forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> UTCTime -> r
    $cgmapQr :: forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> UTCTime -> r
    gmapQr :: forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> UTCTime -> r
    $cgmapQ :: forall u. (forall d. Data d => d -> u) -> UTCTime -> [u]
    gmapQ :: forall u. (forall d. Data d => d -> u) -> UTCTime -> [u]
    $cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> UTCTime -> u
    gmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> UTCTime -> u
    $cgmapM :: forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> UTCTime -> m UTCTime
    gmapM :: forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> UTCTime -> m UTCTime
    $cgmapMp :: forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> UTCTime -> m UTCTime
    gmapMp :: forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> UTCTime -> m UTCTime
    $cgmapMo :: forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> UTCTime -> m UTCTime
    gmapMo :: forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> UTCTime -> m UTCTime
    Data, (forall x. UTCTime -> Rep UTCTime x)
    -> (forall x. Rep UTCTime x -> UTCTime) -> Generic UTCTime
    forall x. Rep UTCTime x -> UTCTime
    forall x. UTCTime -> Rep UTCTime x
    forall a.
    (forall x. a -> Rep a x) -> (forall x. Rep a x -> a) -> Generic a
    $cfrom :: forall x. UTCTime -> Rep UTCTime x
    from :: forall x. UTCTime -> Rep UTCTime x
    $cto :: forall x. Rep UTCTime x -> UTCTime
    to :: forall x. Rep UTCTime x -> UTCTime
    Generic, (forall (m :: * -> *). Quote m => UTCTime -> m Exp)
    -> (forall (m :: * -> *). Quote m => UTCTime -> Code m UTCTime)
    -> Lift UTCTime
    forall t.
    (forall (m :: * -> *). Quote m => t -> m Exp)
    -> (forall (m :: * -> *). Quote m => t -> Code m t) -> Lift t
    forall (m :: * -> *). Quote m => UTCTime -> m Exp
    forall (m :: * -> *). Quote m => UTCTime -> Code m UTCTime
    $clift :: forall (m :: * -> *). Quote m => UTCTime -> m Exp
    lift :: forall (m :: * -> *). Quote m => UTCTime -> m Exp
    $cliftTyped :: forall (m :: * -> *). Quote m => UTCTime -> Code m UTCTime
    liftTyped :: forall (m :: * -> *). Quote m => UTCTime -> Code m UTCTime
    TH.Lift)

    instance NFData UTCTime where
        rnf :: UTCTime -> ()
    rnf (UTCTime Day
    d DiffTime
    t) = Day -> ()
    forall a. NFData a => a -> ()
    rnf Day
    d () -> () -> ()
    forall a b. a -> b -> b
    `seq` DiffTime -> ()
    forall a. NFData a => a -> ()
    rnf DiffTime
    t () -> () -> ()
    forall a b. a -> b -> b
    `seq` ()