module MessageDb.Units
( NumberOfMessages (..),
Microseconds (..),
)
where
import Numeric.Natural (Natural)
newtype NumberOfMessages = NumberOfMessages
{ NumberOfMessages -> Natural
numberOfMessagesToNatural :: Natural
}
deriving (NumberOfMessages -> NumberOfMessages -> Bool
(NumberOfMessages -> NumberOfMessages -> Bool)
-> (NumberOfMessages -> NumberOfMessages -> Bool)
-> Eq NumberOfMessages
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: NumberOfMessages -> NumberOfMessages -> Bool
$c/= :: NumberOfMessages -> NumberOfMessages -> Bool
== :: NumberOfMessages -> NumberOfMessages -> Bool
$c== :: NumberOfMessages -> NumberOfMessages -> Bool
Eq, Eq NumberOfMessages
Eq NumberOfMessages
-> (NumberOfMessages -> NumberOfMessages -> Ordering)
-> (NumberOfMessages -> NumberOfMessages -> Bool)
-> (NumberOfMessages -> NumberOfMessages -> Bool)
-> (NumberOfMessages -> NumberOfMessages -> Bool)
-> (NumberOfMessages -> NumberOfMessages -> Bool)
-> (NumberOfMessages -> NumberOfMessages -> NumberOfMessages)
-> (NumberOfMessages -> NumberOfMessages -> NumberOfMessages)
-> Ord NumberOfMessages
NumberOfMessages -> NumberOfMessages -> Bool
NumberOfMessages -> NumberOfMessages -> Ordering
NumberOfMessages -> NumberOfMessages -> NumberOfMessages
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 :: NumberOfMessages -> NumberOfMessages -> NumberOfMessages
$cmin :: NumberOfMessages -> NumberOfMessages -> NumberOfMessages
max :: NumberOfMessages -> NumberOfMessages -> NumberOfMessages
$cmax :: NumberOfMessages -> NumberOfMessages -> NumberOfMessages
>= :: NumberOfMessages -> NumberOfMessages -> Bool
$c>= :: NumberOfMessages -> NumberOfMessages -> Bool
> :: NumberOfMessages -> NumberOfMessages -> Bool
$c> :: NumberOfMessages -> NumberOfMessages -> Bool
<= :: NumberOfMessages -> NumberOfMessages -> Bool
$c<= :: NumberOfMessages -> NumberOfMessages -> Bool
< :: NumberOfMessages -> NumberOfMessages -> Bool
$c< :: NumberOfMessages -> NumberOfMessages -> Bool
compare :: NumberOfMessages -> NumberOfMessages -> Ordering
$ccompare :: NumberOfMessages -> NumberOfMessages -> Ordering
$cp1Ord :: Eq NumberOfMessages
Ord, Integer -> NumberOfMessages
NumberOfMessages -> NumberOfMessages
NumberOfMessages -> NumberOfMessages -> NumberOfMessages
(NumberOfMessages -> NumberOfMessages -> NumberOfMessages)
-> (NumberOfMessages -> NumberOfMessages -> NumberOfMessages)
-> (NumberOfMessages -> NumberOfMessages -> NumberOfMessages)
-> (NumberOfMessages -> NumberOfMessages)
-> (NumberOfMessages -> NumberOfMessages)
-> (NumberOfMessages -> NumberOfMessages)
-> (Integer -> NumberOfMessages)
-> Num NumberOfMessages
forall a.
(a -> a -> a)
-> (a -> a -> a)
-> (a -> a -> a)
-> (a -> a)
-> (a -> a)
-> (a -> a)
-> (Integer -> a)
-> Num a
fromInteger :: Integer -> NumberOfMessages
$cfromInteger :: Integer -> NumberOfMessages
signum :: NumberOfMessages -> NumberOfMessages
$csignum :: NumberOfMessages -> NumberOfMessages
abs :: NumberOfMessages -> NumberOfMessages
$cabs :: NumberOfMessages -> NumberOfMessages
negate :: NumberOfMessages -> NumberOfMessages
$cnegate :: NumberOfMessages -> NumberOfMessages
* :: NumberOfMessages -> NumberOfMessages -> NumberOfMessages
$c* :: NumberOfMessages -> NumberOfMessages -> NumberOfMessages
- :: NumberOfMessages -> NumberOfMessages -> NumberOfMessages
$c- :: NumberOfMessages -> NumberOfMessages -> NumberOfMessages
+ :: NumberOfMessages -> NumberOfMessages -> NumberOfMessages
$c+ :: NumberOfMessages -> NumberOfMessages -> NumberOfMessages
Num, Num NumberOfMessages
Ord NumberOfMessages
Num NumberOfMessages
-> Ord NumberOfMessages
-> (NumberOfMessages -> Rational)
-> Real NumberOfMessages
NumberOfMessages -> Rational
forall a. Num a -> Ord a -> (a -> Rational) -> Real a
toRational :: NumberOfMessages -> Rational
$ctoRational :: NumberOfMessages -> Rational
$cp2Real :: Ord NumberOfMessages
$cp1Real :: Num NumberOfMessages
Real, Int -> NumberOfMessages
NumberOfMessages -> Int
NumberOfMessages -> [NumberOfMessages]
NumberOfMessages -> NumberOfMessages
NumberOfMessages -> NumberOfMessages -> [NumberOfMessages]
NumberOfMessages
-> NumberOfMessages -> NumberOfMessages -> [NumberOfMessages]
(NumberOfMessages -> NumberOfMessages)
-> (NumberOfMessages -> NumberOfMessages)
-> (Int -> NumberOfMessages)
-> (NumberOfMessages -> Int)
-> (NumberOfMessages -> [NumberOfMessages])
-> (NumberOfMessages -> NumberOfMessages -> [NumberOfMessages])
-> (NumberOfMessages -> NumberOfMessages -> [NumberOfMessages])
-> (NumberOfMessages
-> NumberOfMessages -> NumberOfMessages -> [NumberOfMessages])
-> Enum NumberOfMessages
forall a.
(a -> a)
-> (a -> a)
-> (Int -> a)
-> (a -> Int)
-> (a -> [a])
-> (a -> a -> [a])
-> (a -> a -> [a])
-> (a -> a -> a -> [a])
-> Enum a
enumFromThenTo :: NumberOfMessages
-> NumberOfMessages -> NumberOfMessages -> [NumberOfMessages]
$cenumFromThenTo :: NumberOfMessages
-> NumberOfMessages -> NumberOfMessages -> [NumberOfMessages]
enumFromTo :: NumberOfMessages -> NumberOfMessages -> [NumberOfMessages]
$cenumFromTo :: NumberOfMessages -> NumberOfMessages -> [NumberOfMessages]
enumFromThen :: NumberOfMessages -> NumberOfMessages -> [NumberOfMessages]
$cenumFromThen :: NumberOfMessages -> NumberOfMessages -> [NumberOfMessages]
enumFrom :: NumberOfMessages -> [NumberOfMessages]
$cenumFrom :: NumberOfMessages -> [NumberOfMessages]
fromEnum :: NumberOfMessages -> Int
$cfromEnum :: NumberOfMessages -> Int
toEnum :: Int -> NumberOfMessages
$ctoEnum :: Int -> NumberOfMessages
pred :: NumberOfMessages -> NumberOfMessages
$cpred :: NumberOfMessages -> NumberOfMessages
succ :: NumberOfMessages -> NumberOfMessages
$csucc :: NumberOfMessages -> NumberOfMessages
Enum, Enum NumberOfMessages
Real NumberOfMessages
Real NumberOfMessages
-> Enum NumberOfMessages
-> (NumberOfMessages -> NumberOfMessages -> NumberOfMessages)
-> (NumberOfMessages -> NumberOfMessages -> NumberOfMessages)
-> (NumberOfMessages -> NumberOfMessages -> NumberOfMessages)
-> (NumberOfMessages -> NumberOfMessages -> NumberOfMessages)
-> (NumberOfMessages
-> NumberOfMessages -> (NumberOfMessages, NumberOfMessages))
-> (NumberOfMessages
-> NumberOfMessages -> (NumberOfMessages, NumberOfMessages))
-> (NumberOfMessages -> Integer)
-> Integral NumberOfMessages
NumberOfMessages -> Integer
NumberOfMessages
-> NumberOfMessages -> (NumberOfMessages, NumberOfMessages)
NumberOfMessages -> NumberOfMessages -> NumberOfMessages
forall a.
Real a
-> Enum a
-> (a -> a -> a)
-> (a -> a -> a)
-> (a -> a -> a)
-> (a -> a -> a)
-> (a -> a -> (a, a))
-> (a -> a -> (a, a))
-> (a -> Integer)
-> Integral a
toInteger :: NumberOfMessages -> Integer
$ctoInteger :: NumberOfMessages -> Integer
divMod :: NumberOfMessages
-> NumberOfMessages -> (NumberOfMessages, NumberOfMessages)
$cdivMod :: NumberOfMessages
-> NumberOfMessages -> (NumberOfMessages, NumberOfMessages)
quotRem :: NumberOfMessages
-> NumberOfMessages -> (NumberOfMessages, NumberOfMessages)
$cquotRem :: NumberOfMessages
-> NumberOfMessages -> (NumberOfMessages, NumberOfMessages)
mod :: NumberOfMessages -> NumberOfMessages -> NumberOfMessages
$cmod :: NumberOfMessages -> NumberOfMessages -> NumberOfMessages
div :: NumberOfMessages -> NumberOfMessages -> NumberOfMessages
$cdiv :: NumberOfMessages -> NumberOfMessages -> NumberOfMessages
rem :: NumberOfMessages -> NumberOfMessages -> NumberOfMessages
$crem :: NumberOfMessages -> NumberOfMessages -> NumberOfMessages
quot :: NumberOfMessages -> NumberOfMessages -> NumberOfMessages
$cquot :: NumberOfMessages -> NumberOfMessages -> NumberOfMessages
$cp2Integral :: Enum NumberOfMessages
$cp1Integral :: Real NumberOfMessages
Integral)
deriving (Int -> NumberOfMessages -> ShowS
[NumberOfMessages] -> ShowS
NumberOfMessages -> String
(Int -> NumberOfMessages -> ShowS)
-> (NumberOfMessages -> String)
-> ([NumberOfMessages] -> ShowS)
-> Show NumberOfMessages
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [NumberOfMessages] -> ShowS
$cshowList :: [NumberOfMessages] -> ShowS
show :: NumberOfMessages -> String
$cshow :: NumberOfMessages -> String
showsPrec :: Int -> NumberOfMessages -> ShowS
$cshowsPrec :: Int -> NumberOfMessages -> ShowS
Show) via Natural
newtype Microseconds = Microseconds
{ Microseconds -> Natural
microsecondsToNatural :: Natural
}
deriving (Microseconds -> Microseconds -> Bool
(Microseconds -> Microseconds -> Bool)
-> (Microseconds -> Microseconds -> Bool) -> Eq Microseconds
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: Microseconds -> Microseconds -> Bool
$c/= :: Microseconds -> Microseconds -> Bool
== :: Microseconds -> Microseconds -> Bool
$c== :: Microseconds -> Microseconds -> Bool
Eq, Eq Microseconds
Eq Microseconds
-> (Microseconds -> Microseconds -> Ordering)
-> (Microseconds -> Microseconds -> Bool)
-> (Microseconds -> Microseconds -> Bool)
-> (Microseconds -> Microseconds -> Bool)
-> (Microseconds -> Microseconds -> Bool)
-> (Microseconds -> Microseconds -> Microseconds)
-> (Microseconds -> Microseconds -> Microseconds)
-> Ord Microseconds
Microseconds -> Microseconds -> Bool
Microseconds -> Microseconds -> Ordering
Microseconds -> Microseconds -> Microseconds
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 :: Microseconds -> Microseconds -> Microseconds
$cmin :: Microseconds -> Microseconds -> Microseconds
max :: Microseconds -> Microseconds -> Microseconds
$cmax :: Microseconds -> Microseconds -> Microseconds
>= :: Microseconds -> Microseconds -> Bool
$c>= :: Microseconds -> Microseconds -> Bool
> :: Microseconds -> Microseconds -> Bool
$c> :: Microseconds -> Microseconds -> Bool
<= :: Microseconds -> Microseconds -> Bool
$c<= :: Microseconds -> Microseconds -> Bool
< :: Microseconds -> Microseconds -> Bool
$c< :: Microseconds -> Microseconds -> Bool
compare :: Microseconds -> Microseconds -> Ordering
$ccompare :: Microseconds -> Microseconds -> Ordering
$cp1Ord :: Eq Microseconds
Ord, Integer -> Microseconds
Microseconds -> Microseconds
Microseconds -> Microseconds -> Microseconds
(Microseconds -> Microseconds -> Microseconds)
-> (Microseconds -> Microseconds -> Microseconds)
-> (Microseconds -> Microseconds -> Microseconds)
-> (Microseconds -> Microseconds)
-> (Microseconds -> Microseconds)
-> (Microseconds -> Microseconds)
-> (Integer -> Microseconds)
-> Num Microseconds
forall a.
(a -> a -> a)
-> (a -> a -> a)
-> (a -> a -> a)
-> (a -> a)
-> (a -> a)
-> (a -> a)
-> (Integer -> a)
-> Num a
fromInteger :: Integer -> Microseconds
$cfromInteger :: Integer -> Microseconds
signum :: Microseconds -> Microseconds
$csignum :: Microseconds -> Microseconds
abs :: Microseconds -> Microseconds
$cabs :: Microseconds -> Microseconds
negate :: Microseconds -> Microseconds
$cnegate :: Microseconds -> Microseconds
* :: Microseconds -> Microseconds -> Microseconds
$c* :: Microseconds -> Microseconds -> Microseconds
- :: Microseconds -> Microseconds -> Microseconds
$c- :: Microseconds -> Microseconds -> Microseconds
+ :: Microseconds -> Microseconds -> Microseconds
$c+ :: Microseconds -> Microseconds -> Microseconds
Num, Num Microseconds
Ord Microseconds
Num Microseconds
-> Ord Microseconds
-> (Microseconds -> Rational)
-> Real Microseconds
Microseconds -> Rational
forall a. Num a -> Ord a -> (a -> Rational) -> Real a
toRational :: Microseconds -> Rational
$ctoRational :: Microseconds -> Rational
$cp2Real :: Ord Microseconds
$cp1Real :: Num Microseconds
Real, Int -> Microseconds
Microseconds -> Int
Microseconds -> [Microseconds]
Microseconds -> Microseconds
Microseconds -> Microseconds -> [Microseconds]
Microseconds -> Microseconds -> Microseconds -> [Microseconds]
(Microseconds -> Microseconds)
-> (Microseconds -> Microseconds)
-> (Int -> Microseconds)
-> (Microseconds -> Int)
-> (Microseconds -> [Microseconds])
-> (Microseconds -> Microseconds -> [Microseconds])
-> (Microseconds -> Microseconds -> [Microseconds])
-> (Microseconds -> Microseconds -> Microseconds -> [Microseconds])
-> Enum Microseconds
forall a.
(a -> a)
-> (a -> a)
-> (Int -> a)
-> (a -> Int)
-> (a -> [a])
-> (a -> a -> [a])
-> (a -> a -> [a])
-> (a -> a -> a -> [a])
-> Enum a
enumFromThenTo :: Microseconds -> Microseconds -> Microseconds -> [Microseconds]
$cenumFromThenTo :: Microseconds -> Microseconds -> Microseconds -> [Microseconds]
enumFromTo :: Microseconds -> Microseconds -> [Microseconds]
$cenumFromTo :: Microseconds -> Microseconds -> [Microseconds]
enumFromThen :: Microseconds -> Microseconds -> [Microseconds]
$cenumFromThen :: Microseconds -> Microseconds -> [Microseconds]
enumFrom :: Microseconds -> [Microseconds]
$cenumFrom :: Microseconds -> [Microseconds]
fromEnum :: Microseconds -> Int
$cfromEnum :: Microseconds -> Int
toEnum :: Int -> Microseconds
$ctoEnum :: Int -> Microseconds
pred :: Microseconds -> Microseconds
$cpred :: Microseconds -> Microseconds
succ :: Microseconds -> Microseconds
$csucc :: Microseconds -> Microseconds
Enum, Enum Microseconds
Real Microseconds
Real Microseconds
-> Enum Microseconds
-> (Microseconds -> Microseconds -> Microseconds)
-> (Microseconds -> Microseconds -> Microseconds)
-> (Microseconds -> Microseconds -> Microseconds)
-> (Microseconds -> Microseconds -> Microseconds)
-> (Microseconds -> Microseconds -> (Microseconds, Microseconds))
-> (Microseconds -> Microseconds -> (Microseconds, Microseconds))
-> (Microseconds -> Integer)
-> Integral Microseconds
Microseconds -> Integer
Microseconds -> Microseconds -> (Microseconds, Microseconds)
Microseconds -> Microseconds -> Microseconds
forall a.
Real a
-> Enum a
-> (a -> a -> a)
-> (a -> a -> a)
-> (a -> a -> a)
-> (a -> a -> a)
-> (a -> a -> (a, a))
-> (a -> a -> (a, a))
-> (a -> Integer)
-> Integral a
toInteger :: Microseconds -> Integer
$ctoInteger :: Microseconds -> Integer
divMod :: Microseconds -> Microseconds -> (Microseconds, Microseconds)
$cdivMod :: Microseconds -> Microseconds -> (Microseconds, Microseconds)
quotRem :: Microseconds -> Microseconds -> (Microseconds, Microseconds)
$cquotRem :: Microseconds -> Microseconds -> (Microseconds, Microseconds)
mod :: Microseconds -> Microseconds -> Microseconds
$cmod :: Microseconds -> Microseconds -> Microseconds
div :: Microseconds -> Microseconds -> Microseconds
$cdiv :: Microseconds -> Microseconds -> Microseconds
rem :: Microseconds -> Microseconds -> Microseconds
$crem :: Microseconds -> Microseconds -> Microseconds
quot :: Microseconds -> Microseconds -> Microseconds
$cquot :: Microseconds -> Microseconds -> Microseconds
$cp2Integral :: Enum Microseconds
$cp1Integral :: Real Microseconds
Integral)
deriving (Int -> Microseconds -> ShowS
[Microseconds] -> ShowS
Microseconds -> String
(Int -> Microseconds -> ShowS)
-> (Microseconds -> String)
-> ([Microseconds] -> ShowS)
-> Show Microseconds
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [Microseconds] -> ShowS
$cshowList :: [Microseconds] -> ShowS
show :: Microseconds -> String
$cshow :: Microseconds -> String
showsPrec :: Int -> Microseconds -> ShowS
$cshowsPrec :: Int -> Microseconds -> ShowS
Show) via Natural