File: Time.hs

package info (click to toggle)
haskell98-report 20080907-9
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster
  • size: 2,144 kB
  • sloc: haskell: 4,078; makefile: 322
file content (44 lines) | stat: -rw-r--r-- 1,537 bytes parent folder | download | duplicates (9)
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
33
34
35
36
37
38
39
40
41
42
43
44
module Time (
	ClockTime, 
	Month(January,February,March,April,May,June,
	      July,August,September,October,November,December),
	Day(Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday),
	CalendarTime(CalendarTime, ctYear, ctMonth, ctDay, ctHour, ctMin,
		     ctPicosec, ctWDay, ctYDay, ctTZName, ctTZ, ctIsDST),
	TimeDiff(TimeDiff, tdYear, tdMonth, tdDay, tdHour,
		 tdMin, tdSec, tdPicosec),
	getClockTime, addToClockTime, diffClockTimes,
        toCalendarTime, toUTCTime, toClockTime,
        calendarTimeToString, formatCalendarTime ) where

import Ix(Ix)

data ClockTime = ...			-- Implementation-dependent
instance Ord  ClockTime where ...
instance Eq   ClockTime where ...

data Month =  January   | February | March    | April
           |  May       | June     | July     | August
           |  September | October  | November | December
           deriving (Eq, Ord, Enum, Bounded, Ix, Read, Show)

data Day   =  Sunday | Monday  | Tuesday  | Wednesday | Thursday 
           |  Friday | Saturday
           deriving (Eq, Ord, Enum, Bounded, Ix, Read, Show)

data CalendarTime = CalendarTime {
		ctYear  			:: Int,
	        ctMonth 			:: Month,
	        ctDay, ctHour, ctMin, ctSec 	:: Int,
		ctPicosec			:: Integer,
		ctWDay   			:: Day,
		ctYDay		     		:: Int,
		ctTZName	 		:: String,
		ctTZ         			:: Int,
		ctIsDST				:: Bool
	} deriving (Eq, Ord, Read, Show)

data TimeDiff = TimeDiff {
		tdYear, tdMonth, tdDay, tdHour, tdMin, tdSec :: Int,
		tdPicosec				     :: Integer
	} deriving (Eq, Ord, Read, Show)