module UVMHS.Core.Time where

import UVMHS.Core.Init
import UVMHS.Core.Classes

import qualified Data.Time.Clock as Time
import qualified Prelude as HS

infixl 5 ,

type Time = Time.UTCTime
type TimeD = Time.NominalDiffTime

secondsTimeD  TimeD  𝔻
secondsTimeD :: TimeD -> 𝔻
secondsTimeD = TimeD -> 𝔻
forall a b. (Real a, Fractional b) => a -> b
HS.realToFrac

instance Zero TimeD where {zero :: TimeD
zero = ℕ -> TimeD
forall a b. (Integral a, Num b) => a -> b
HS.fromIntegral (ℕ -> TimeD) -> ℕ -> TimeD
forall a b. (a -> b) -> a -> b
$ ℕ -> ℕ
𝕟 0}
instance Plus TimeD where {+ :: TimeD -> TimeD -> TimeD
(+) = TimeD -> TimeD -> TimeD
forall a. Num a => a -> a -> a
(HS.+)}
instance One TimeD where {one :: TimeD
one = ℕ -> TimeD
forall a b. (Integral a, Num b) => a -> b
HS.fromIntegral (ℕ -> TimeD) -> ℕ -> TimeD
forall a b. (a -> b) -> a -> b
$ ℕ -> ℕ
𝕟 1}
instance Times TimeD where {× :: TimeD -> TimeD -> TimeD
(×) = TimeD -> TimeD -> TimeD
forall a. Num a => a -> a -> a
(HS.*)}

instance Additive TimeD
instance Multiplicative TimeD

(⨺)  Time  Time  TimeD
⨺ :: Time -> Time -> TimeD
(⨺) = Time -> Time -> TimeD
Time.diffUTCTime

(⨹)  Time  TimeD  Time
⨹ :: Time -> TimeD -> Time
(⨹) = (TimeD -> Time -> Time) -> Time -> TimeD -> Time
forall a b c. (a -> b -> c) -> b -> a -> c
flip TimeD -> Time -> Time
Time.addUTCTime

now  IO Time
now :: IO Time
now = IO Time
Time.getCurrentTime