module Network.HTTP.Date.Types (
    HTTPDate
  , hdYear
  , hdMonth
  , hdDay
  , hdHour
  , hdMinute
  , hdSecond
  , hdWkday
  , defaultHTTPDate
  ) where

{-|
  Data structure for HTTP Date. This value should be specified
  with 'defaultHTTPDate' and its field labels.
-}
data HTTPDate = HTTPDate {
    HTTPDate -> Int
hdYear   :: !Int
  , HTTPDate -> Int
hdMonth  :: !Int
  , HTTPDate -> Int
hdDay    :: !Int
  , HTTPDate -> Int
hdHour   :: !Int
  , HTTPDate -> Int
hdMinute :: !Int
  , HTTPDate -> Int
hdSecond :: !Int
  , HTTPDate -> Int
hdWkday  :: !Int
  } deriving (HTTPDate -> HTTPDate -> Bool
(HTTPDate -> HTTPDate -> Bool)
-> (HTTPDate -> HTTPDate -> Bool) -> Eq HTTPDate
forall a. (a -> a -> Bool) -> (a -> a -> Bool) -> Eq a
/= :: HTTPDate -> HTTPDate -> Bool
$c/= :: HTTPDate -> HTTPDate -> Bool
== :: HTTPDate -> HTTPDate -> Bool
$c== :: HTTPDate -> HTTPDate -> Bool
Eq, Int -> HTTPDate -> ShowS
[HTTPDate] -> ShowS
HTTPDate -> String
(Int -> HTTPDate -> ShowS)
-> (HTTPDate -> String) -> ([HTTPDate] -> ShowS) -> Show HTTPDate
forall a.
(Int -> a -> ShowS) -> (a -> String) -> ([a] -> ShowS) -> Show a
showList :: [HTTPDate] -> ShowS
$cshowList :: [HTTPDate] -> ShowS
show :: HTTPDate -> String
$cshow :: HTTPDate -> String
showsPrec :: Int -> HTTPDate -> ShowS
$cshowsPrec :: Int -> HTTPDate -> ShowS
Show, Eq HTTPDate
Eq HTTPDate
-> (HTTPDate -> HTTPDate -> Ordering)
-> (HTTPDate -> HTTPDate -> Bool)
-> (HTTPDate -> HTTPDate -> Bool)
-> (HTTPDate -> HTTPDate -> Bool)
-> (HTTPDate -> HTTPDate -> Bool)
-> (HTTPDate -> HTTPDate -> HTTPDate)
-> (HTTPDate -> HTTPDate -> HTTPDate)
-> Ord HTTPDate
HTTPDate -> HTTPDate -> Bool
HTTPDate -> HTTPDate -> Ordering
HTTPDate -> HTTPDate -> HTTPDate
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 :: HTTPDate -> HTTPDate -> HTTPDate
$cmin :: HTTPDate -> HTTPDate -> HTTPDate
max :: HTTPDate -> HTTPDate -> HTTPDate
$cmax :: HTTPDate -> HTTPDate -> HTTPDate
>= :: HTTPDate -> HTTPDate -> Bool
$c>= :: HTTPDate -> HTTPDate -> Bool
> :: HTTPDate -> HTTPDate -> Bool
$c> :: HTTPDate -> HTTPDate -> Bool
<= :: HTTPDate -> HTTPDate -> Bool
$c<= :: HTTPDate -> HTTPDate -> Bool
< :: HTTPDate -> HTTPDate -> Bool
$c< :: HTTPDate -> HTTPDate -> Bool
compare :: HTTPDate -> HTTPDate -> Ordering
$ccompare :: HTTPDate -> HTTPDate -> Ordering
$cp1Ord :: Eq HTTPDate
Ord)

{-|
  A default value for 'HTTPDate'.
-}
-- 1970/1/1 is Thu (4)
defaultHTTPDate :: HTTPDate
defaultHTTPDate :: HTTPDate
defaultHTTPDate = Int -> Int -> Int -> Int -> Int -> Int -> Int -> HTTPDate
HTTPDate Int
1970 Int
1 Int
1 Int
0 Int
0 Int
0 Int
4