module OpenTelemetry.Common where

import Data.Word (Word8)
import System.Clock (TimeSpec)


newtype Timestamp = Timestamp TimeSpec
  deriving (ReadPrec [Timestamp]
ReadPrec Timestamp
Int -> ReadS Timestamp
ReadS [Timestamp]
(Int -> ReadS Timestamp)
-> ReadS [Timestamp]
-> ReadPrec Timestamp
-> ReadPrec [Timestamp]
-> Read Timestamp
forall a.
(Int -> ReadS a)
-> ReadS [a] -> ReadPrec a -> ReadPrec [a] -> Read a
$creadsPrec :: Int -> ReadS Timestamp
readsPrec :: Int -> ReadS Timestamp
$creadList :: ReadS [Timestamp]
readList :: ReadS [Timestamp]
$creadPrec :: ReadPrec Timestamp
readPrec :: ReadPrec Timestamp
$creadListPrec :: ReadPrec [Timestamp]
readListPrec :: ReadPrec [Timestamp]
Read, Int -> Timestamp -> ShowS
[Timestamp] -> ShowS
Timestamp -> String
(Int -> Timestamp -> ShowS)
-> (Timestamp -> String)
-> ([Timestamp] -> ShowS)
-> Show Timestamp
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> Timestamp -> ShowS
showsPrec :: Int -> Timestamp -> ShowS
$cshow :: Timestamp -> String
show :: Timestamp -> String
$cshowList :: [Timestamp] -> ShowS
showList :: [Timestamp] -> ShowS
Show, Timestamp -> Timestamp -> Bool
(Timestamp -> Timestamp -> Bool)
-> (Timestamp -> Timestamp -> Bool) -> Eq Timestamp
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: Timestamp -> Timestamp -> Bool
== :: Timestamp -> Timestamp -> Bool
$c/= :: Timestamp -> Timestamp -> Bool
/= :: Timestamp -> Timestamp -> Bool
Eq, Eq Timestamp
Eq Timestamp =>
(Timestamp -> Timestamp -> Ordering)
-> (Timestamp -> Timestamp -> Bool)
-> (Timestamp -> Timestamp -> Bool)
-> (Timestamp -> Timestamp -> Bool)
-> (Timestamp -> Timestamp -> Bool)
-> (Timestamp -> Timestamp -> Timestamp)
-> (Timestamp -> Timestamp -> Timestamp)
-> Ord Timestamp
Timestamp -> Timestamp -> Bool
Timestamp -> Timestamp -> Ordering
Timestamp -> Timestamp -> Timestamp
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
$ccompare :: Timestamp -> Timestamp -> Ordering
compare :: Timestamp -> Timestamp -> Ordering
$c< :: Timestamp -> Timestamp -> Bool
< :: Timestamp -> Timestamp -> Bool
$c<= :: Timestamp -> Timestamp -> Bool
<= :: Timestamp -> Timestamp -> Bool
$c> :: Timestamp -> Timestamp -> Bool
> :: Timestamp -> Timestamp -> Bool
$c>= :: Timestamp -> Timestamp -> Bool
>= :: Timestamp -> Timestamp -> Bool
$cmax :: Timestamp -> Timestamp -> Timestamp
max :: Timestamp -> Timestamp -> Timestamp
$cmin :: Timestamp -> Timestamp -> Timestamp
min :: Timestamp -> Timestamp -> Timestamp
Ord)


-- | Contain details about the trace. Unlike TraceState values, TraceFlags are present in all traces. The current version of the specification only supports a single flag called sampled.
newtype TraceFlags = TraceFlags Word8
  deriving (Int -> TraceFlags -> ShowS
[TraceFlags] -> ShowS
TraceFlags -> String
(Int -> TraceFlags -> ShowS)
-> (TraceFlags -> String)
-> ([TraceFlags] -> ShowS)
-> Show TraceFlags
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
$cshowsPrec :: Int -> TraceFlags -> ShowS
showsPrec :: Int -> TraceFlags -> ShowS
$cshow :: TraceFlags -> String
show :: TraceFlags -> String
$cshowList :: [TraceFlags] -> ShowS
showList :: [TraceFlags] -> ShowS
Show, TraceFlags -> TraceFlags -> Bool
(TraceFlags -> TraceFlags -> Bool)
-> (TraceFlags -> TraceFlags -> Bool) -> Eq TraceFlags
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
$c== :: TraceFlags -> TraceFlags -> Bool
== :: TraceFlags -> TraceFlags -> Bool
$c/= :: TraceFlags -> TraceFlags -> Bool
/= :: TraceFlags -> TraceFlags -> Bool
Eq, Eq TraceFlags
Eq TraceFlags =>
(TraceFlags -> TraceFlags -> Ordering)
-> (TraceFlags -> TraceFlags -> Bool)
-> (TraceFlags -> TraceFlags -> Bool)
-> (TraceFlags -> TraceFlags -> Bool)
-> (TraceFlags -> TraceFlags -> Bool)
-> (TraceFlags -> TraceFlags -> TraceFlags)
-> (TraceFlags -> TraceFlags -> TraceFlags)
-> Ord TraceFlags
TraceFlags -> TraceFlags -> Bool
TraceFlags -> TraceFlags -> Ordering
TraceFlags -> TraceFlags -> TraceFlags
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
$ccompare :: TraceFlags -> TraceFlags -> Ordering
compare :: TraceFlags -> TraceFlags -> Ordering
$c< :: TraceFlags -> TraceFlags -> Bool
< :: TraceFlags -> TraceFlags -> Bool
$c<= :: TraceFlags -> TraceFlags -> Bool
<= :: TraceFlags -> TraceFlags -> Bool
$c> :: TraceFlags -> TraceFlags -> Bool
> :: TraceFlags -> TraceFlags -> Bool
$c>= :: TraceFlags -> TraceFlags -> Bool
>= :: TraceFlags -> TraceFlags -> Bool
$cmax :: TraceFlags -> TraceFlags -> TraceFlags
max :: TraceFlags -> TraceFlags -> TraceFlags
$cmin :: TraceFlags -> TraceFlags -> TraceFlags
min :: TraceFlags -> TraceFlags -> TraceFlags
Ord)