{-# LANGUAGE Safe #-}

module Data.Time.Clock.Internal.UniversalTime
    (
    -- * Universal Time
    -- | Time as measured by the Earth.
      UniversalTime(..)
    ) where

import Control.DeepSeq
import Data.Data

-- | The Modified Julian Date is the day with the fraction of the day, measured from UT midnight.
-- It's used to represent UT1, which is time as measured by the earth's rotation, adjusted for various wobbles.
newtype UniversalTime = ModJulianDate
    { UniversalTime -> Rational
getModJulianDate :: Rational
    } deriving (UniversalTime -> UniversalTime -> Bool
(UniversalTime -> UniversalTime -> Bool)
-> (UniversalTime -> UniversalTime -> Bool) -> Eq UniversalTime
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: UniversalTime -> UniversalTime -> Bool
$c/= :: UniversalTime -> UniversalTime -> Bool
== :: UniversalTime -> UniversalTime -> Bool
$c== :: UniversalTime -> UniversalTime -> Bool
Eq, Eq UniversalTime
Eq UniversalTime
-> (UniversalTime -> UniversalTime -> Ordering)
-> (UniversalTime -> UniversalTime -> Bool)
-> (UniversalTime -> UniversalTime -> Bool)
-> (UniversalTime -> UniversalTime -> Bool)
-> (UniversalTime -> UniversalTime -> Bool)
-> (UniversalTime -> UniversalTime -> UniversalTime)
-> (UniversalTime -> UniversalTime -> UniversalTime)
-> Ord UniversalTime
UniversalTime -> UniversalTime -> Bool
UniversalTime -> UniversalTime -> Ordering
UniversalTime -> UniversalTime -> UniversalTime
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
min :: UniversalTime -> UniversalTime -> UniversalTime
$cmin :: UniversalTime -> UniversalTime -> UniversalTime
max :: UniversalTime -> UniversalTime -> UniversalTime
$cmax :: UniversalTime -> UniversalTime -> UniversalTime
>= :: UniversalTime -> UniversalTime -> Bool
$c>= :: UniversalTime -> UniversalTime -> Bool
> :: UniversalTime -> UniversalTime -> Bool
$c> :: UniversalTime -> UniversalTime -> Bool
<= :: UniversalTime -> UniversalTime -> Bool
$c<= :: UniversalTime -> UniversalTime -> Bool
< :: UniversalTime -> UniversalTime -> Bool
$c< :: UniversalTime -> UniversalTime -> Bool
compare :: UniversalTime -> UniversalTime -> Ordering
$ccompare :: UniversalTime -> UniversalTime -> Ordering
$cp1Ord :: Eq UniversalTime
Ord, Typeable UniversalTime
DataType
Constr
Typeable UniversalTime
-> (forall (c :: * -> *).
    (forall d b. Data d => c (d -> b) -> d -> c b)
    -> (forall g. g -> c g) -> UniversalTime -> c UniversalTime)
-> (forall (c :: * -> *).
    (forall b r. Data b => c (b -> r) -> c r)
    -> (forall r. r -> c r) -> Constr -> c UniversalTime)
-> (UniversalTime -> Constr)
-> (UniversalTime -> DataType)
-> (forall (t :: * -> *) (c :: * -> *).
    Typeable t =>
    (forall d. Data d => c (t d)) -> Maybe (c UniversalTime))
-> (forall (t :: * -> * -> *) (c :: * -> *).
    Typeable t =>
    (forall d e. (Data d, Data e) => c (t d e))
    -> Maybe (c UniversalTime))
-> ((forall b. Data b => b -> b) -> UniversalTime -> UniversalTime)
-> (forall r r'.
    (r -> r' -> r)
    -> r -> (forall d. Data d => d -> r') -> UniversalTime -> r)
-> (forall r r'.
    (r' -> r -> r)
    -> r -> (forall d. Data d => d -> r') -> UniversalTime -> r)
-> (forall u. (forall d. Data d => d -> u) -> UniversalTime -> [u])
-> (forall u.
    Int -> (forall d. Data d => d -> u) -> UniversalTime -> u)
-> (forall (m :: * -> *).
    Monad m =>
    (forall d. Data d => d -> m d) -> UniversalTime -> m UniversalTime)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> UniversalTime -> m UniversalTime)
-> (forall (m :: * -> *).
    MonadPlus m =>
    (forall d. Data d => d -> m d) -> UniversalTime -> m UniversalTime)
-> Data UniversalTime
UniversalTime -> DataType
UniversalTime -> Constr
(forall b. Data b => b -> b) -> UniversalTime -> UniversalTime
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> UniversalTime -> c UniversalTime
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c UniversalTime
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) -> UniversalTime -> u
forall u. (forall d. Data d => d -> u) -> UniversalTime -> [u]
forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> UniversalTime -> r
forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> UniversalTime -> r
forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> UniversalTime -> m UniversalTime
forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> UniversalTime -> m UniversalTime
forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c UniversalTime
forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> UniversalTime -> c UniversalTime
forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c UniversalTime)
forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c UniversalTime)
$cModJulianDate :: Constr
$tUniversalTime :: DataType
gmapMo :: (forall d. Data d => d -> m d) -> UniversalTime -> m UniversalTime
$cgmapMo :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> UniversalTime -> m UniversalTime
gmapMp :: (forall d. Data d => d -> m d) -> UniversalTime -> m UniversalTime
$cgmapMp :: forall (m :: * -> *).
MonadPlus m =>
(forall d. Data d => d -> m d) -> UniversalTime -> m UniversalTime
gmapM :: (forall d. Data d => d -> m d) -> UniversalTime -> m UniversalTime
$cgmapM :: forall (m :: * -> *).
Monad m =>
(forall d. Data d => d -> m d) -> UniversalTime -> m UniversalTime
gmapQi :: Int -> (forall d. Data d => d -> u) -> UniversalTime -> u
$cgmapQi :: forall u. Int -> (forall d. Data d => d -> u) -> UniversalTime -> u
gmapQ :: (forall d. Data d => d -> u) -> UniversalTime -> [u]
$cgmapQ :: forall u. (forall d. Data d => d -> u) -> UniversalTime -> [u]
gmapQr :: (r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> UniversalTime -> r
$cgmapQr :: forall r r'.
(r' -> r -> r)
-> r -> (forall d. Data d => d -> r') -> UniversalTime -> r
gmapQl :: (r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> UniversalTime -> r
$cgmapQl :: forall r r'.
(r -> r' -> r)
-> r -> (forall d. Data d => d -> r') -> UniversalTime -> r
gmapT :: (forall b. Data b => b -> b) -> UniversalTime -> UniversalTime
$cgmapT :: (forall b. Data b => b -> b) -> UniversalTime -> UniversalTime
dataCast2 :: (forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c UniversalTime)
$cdataCast2 :: forall (t :: * -> * -> *) (c :: * -> *).
Typeable t =>
(forall d e. (Data d, Data e) => c (t d e))
-> Maybe (c UniversalTime)
dataCast1 :: (forall d. Data d => c (t d)) -> Maybe (c UniversalTime)
$cdataCast1 :: forall (t :: * -> *) (c :: * -> *).
Typeable t =>
(forall d. Data d => c (t d)) -> Maybe (c UniversalTime)
dataTypeOf :: UniversalTime -> DataType
$cdataTypeOf :: UniversalTime -> DataType
toConstr :: UniversalTime -> Constr
$ctoConstr :: UniversalTime -> Constr
gunfold :: (forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c UniversalTime
$cgunfold :: forall (c :: * -> *).
(forall b r. Data b => c (b -> r) -> c r)
-> (forall r. r -> c r) -> Constr -> c UniversalTime
gfoldl :: (forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> UniversalTime -> c UniversalTime
$cgfoldl :: forall (c :: * -> *).
(forall d b. Data d => c (d -> b) -> d -> c b)
-> (forall g. g -> c g) -> UniversalTime -> c UniversalTime
$cp1Data :: Typeable UniversalTime
Data, Typeable)

instance NFData UniversalTime where
    rnf :: UniversalTime -> ()
rnf (ModJulianDate Rational
a) = Rational -> ()
forall a. NFData a => a -> ()
rnf Rational
a