{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DerivingVia #-}
module Ouroboros.Consensus.BlockchainTime.WallClock.Types (
SystemStart (..)
, RelativeTime (..)
, addRelTime
, diffRelTime
, fromRelativeTime
, toRelativeTime
, SystemTime (..)
, getSlotLength
, mkSlotLength
, slotLengthFromMillisec
, slotLengthFromSec
, slotLengthToMillisec
, slotLengthToSec
, SlotLength
) where
import Cardano.Slotting.Time
import Data.Time.Clock (NominalDiffTime)
import NoThunks.Class (NoThunks, OnlyCheckWhnfNamed (..))
addRelTime :: NominalDiffTime -> RelativeTime -> RelativeTime
addRelTime :: NominalDiffTime -> RelativeTime -> RelativeTime
addRelTime = NominalDiffTime -> RelativeTime -> RelativeTime
addRelativeTime
diffRelTime :: RelativeTime -> RelativeTime -> NominalDiffTime
diffRelTime :: RelativeTime -> RelativeTime -> NominalDiffTime
diffRelTime = RelativeTime -> RelativeTime -> NominalDiffTime
diffRelativeTime
data SystemTime m = SystemTime {
forall (m :: * -> *). SystemTime m -> m RelativeTime
systemTimeCurrent :: m RelativeTime
, forall (m :: * -> *). SystemTime m -> m ()
systemTimeWait :: m ()
}
deriving Context -> SystemTime m -> IO (Maybe ThunkInfo)
Proxy (SystemTime m) -> String
(Context -> SystemTime m -> IO (Maybe ThunkInfo))
-> (Context -> SystemTime m -> IO (Maybe ThunkInfo))
-> (Proxy (SystemTime m) -> String)
-> NoThunks (SystemTime m)
forall a.
(Context -> a -> IO (Maybe ThunkInfo))
-> (Context -> a -> IO (Maybe ThunkInfo))
-> (Proxy a -> String)
-> NoThunks a
forall (m :: * -> *).
Context -> SystemTime m -> IO (Maybe ThunkInfo)
forall (m :: * -> *). Proxy (SystemTime m) -> String
$cnoThunks :: forall (m :: * -> *).
Context -> SystemTime m -> IO (Maybe ThunkInfo)
noThunks :: Context -> SystemTime m -> IO (Maybe ThunkInfo)
$cwNoThunks :: forall (m :: * -> *).
Context -> SystemTime m -> IO (Maybe ThunkInfo)
wNoThunks :: Context -> SystemTime m -> IO (Maybe ThunkInfo)
$cshowTypeOf :: forall (m :: * -> *). Proxy (SystemTime m) -> String
showTypeOf :: Proxy (SystemTime m) -> String
NoThunks via OnlyCheckWhnfNamed "SystemTime" (SystemTime m)