Prime -> 2010
[haskell-report.git] / report / lib-hdrs / Time.hs
1 module Time (
2 ClockTime,
3 Month(January,February,March,April,May,June,
4 July,August,September,October,November,December),
5 Day(Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday),
6 CalendarTime(CalendarTime, ctYear, ctMonth, ctDay, ctHour, ctMin,
7 ctSec, ctPicosec, ctWDay, ctYDay,
8 ctTZName, ctTZ, ctIsDST),
9 TimeDiff(TimeDiff, tdYear, tdMonth, tdDay, tdHour,
10 tdMin, tdSec, tdPicosec),
11 getClockTime, addToClockTime, diffClockTimes,
12 toCalendarTime, toUTCTime, toClockTime,
13 calendarTimeToString, formatCalendarTime ) where
14
15 import Ix(Ix)
16
17 data ClockTime = ... -- Implementation-dependent
18 instance Ord ClockTime where ...
19 instance Eq ClockTime where ...
20
21 data Month = January | February | March | April
22 | May | June | July | August
23 | September | October | November | December
24 deriving (Eq, Ord, Enum, Bounded, Ix, Read, Show)
25
26 data Day = Sunday | Monday | Tuesday | Wednesday | Thursday
27 | Friday | Saturday
28 deriving (Eq, Ord, Enum, Bounded, Ix, Read, Show)
29
30 data CalendarTime = CalendarTime {
31 ctYear :: Int,
32 ctMonth :: Month,
33 ctDay, ctHour, ctMin, ctSec :: Int,
34 ctPicosec :: Integer,
35 ctWDay :: Day,
36 ctYDay :: Int,
37 ctTZName :: String,
38 ctTZ :: Int,
39 ctIsDST :: Bool
40 } deriving (Eq, Ord, Read, Show)
41
42 data TimeDiff = TimeDiff {
43 tdYear, tdMonth, tdDay, tdHour, tdMin, tdSec :: Int,
44 tdPicosec :: Integer
45 } deriving (Eq, Ord, Read, Show)