lambdabot-core-5.3: Lambdabot core functionality
Safe HaskellSafe
LanguageHaskell98

Lambdabot.Compat.AltTime

Description

Time compatibility layer (stuff to support old lambdabot state serialization formats)

TODO: trim this down to just the explicitly serialization-related stuff

Synopsis

Documentation

data ClockTime Source #

Wrapping ClockTime (which doesn't provide a Read instance!) seems easier than talking care of the serialization of UserStatus ourselves.

Instances

Instances details
Eq ClockTime Source # 
Instance details

Defined in Lambdabot.Compat.AltTime

Methods

(==) :: ClockTime -> ClockTime -> Bool

(/=) :: ClockTime -> ClockTime -> Bool

Read ClockTime Source # 
Instance details

Defined in Lambdabot.Compat.AltTime

Methods

readsPrec :: Int -> ReadS ClockTime

readList :: ReadS [ClockTime]

readPrec :: ReadPrec ClockTime

readListPrec :: ReadPrec [ClockTime]

Show ClockTime Source # 
Instance details

Defined in Lambdabot.Compat.AltTime

Methods

showsPrec :: Int -> ClockTime -> ShowS

show :: ClockTime -> String

showList :: [ClockTime] -> ShowS

Binary ClockTime Source # 
Instance details

Defined in Lambdabot.Compat.AltTime

Methods

put :: ClockTime -> Put

get :: Get ClockTime

putList :: [ClockTime] -> Put

getClockTime :: IO ClockTime Source #

Retrieve the current clocktime

diffClockTimes :: ClockTime -> ClockTime -> TimeDiff Source #

Difference of two clock times

addToClockTime :: TimeDiff -> ClockTime -> ClockTime Source #

addToClockTime d t adds a time difference d and a -- clock time t to yield a new clock time.

timeDiffPretty :: TimeDiff -> String Source #

Pretty-print a TimeDiff. Both positive and negative Timediffs produce the same output.

14d 17h 8m 53s

newtype TimeDiff Source #

Constructors

TimeDiff NominalDiffTime 

Instances

Instances details
Eq TimeDiff Source # 
Instance details

Defined in Lambdabot.Compat.AltTime

Methods

(==) :: TimeDiff -> TimeDiff -> Bool

(/=) :: TimeDiff -> TimeDiff -> Bool

Ord TimeDiff Source # 
Instance details

Defined in Lambdabot.Compat.AltTime

Methods

compare :: TimeDiff -> TimeDiff -> Ordering

(<) :: TimeDiff -> TimeDiff -> Bool

(<=) :: TimeDiff -> TimeDiff -> Bool

(>) :: TimeDiff -> TimeDiff -> Bool

(>=) :: TimeDiff -> TimeDiff -> Bool

max :: TimeDiff -> TimeDiff -> TimeDiff

min :: TimeDiff -> TimeDiff -> TimeDiff

Read TimeDiff Source # 
Instance details

Defined in Lambdabot.Compat.AltTime

Methods

readsPrec :: Int -> ReadS TimeDiff

readList :: ReadS [TimeDiff]

readPrec :: ReadPrec TimeDiff

readListPrec :: ReadPrec [TimeDiff]

Show TimeDiff Source # 
Instance details

Defined in Lambdabot.Compat.AltTime

Methods

showsPrec :: Int -> TimeDiff -> ShowS

show :: TimeDiff -> String

showList :: [TimeDiff] -> ShowS

Binary TimeDiff Source # 
Instance details

Defined in Lambdabot.Compat.AltTime

Methods

put :: TimeDiff -> Put

get :: Get TimeDiff

putList :: [TimeDiff] -> Put