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