File: Types.hs

package info (click to toggle)
haskell-http-date 0.0.11-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 92 kB
  • sloc: haskell: 349; makefile: 2
file content (32 lines) | stat: -rw-r--r-- 616 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
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 {
    hdYear   :: !Int
  , hdMonth  :: !Int
  , hdDay    :: !Int
  , hdHour   :: !Int
  , hdMinute :: !Int
  , hdSecond :: !Int
  , hdWkday  :: !Int
  } deriving (Eq, Show, Ord)

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