weekdaze-0.0.0.2: A school-timetable problem-solver.

Safe HaskellNone
LanguageHaskell2010

WeekDaze.Temporal.Time

Contents

Description

AUTHOR
Dr. Alistair Ward
DESCRIPTION
  • The time-slot within any day is identified by an abstract enumerable type, & is therefore only loosely related to time; i.e. in this representation, one would specify the first or perhaps the last time-slot, rather than booking for say exactly 9:30.
  • The actual time can only be derived from the time-slot, using knowlege of the time at which the working-day began, & of the constant duration of each time-slot; but it's irrelevant to the scheduling-task.
  • Because no absolute time is associated with specific time-slots within a day, lunch-time merely exists invisibly between two time-slots, & plays no part in the scheduling.
  • The day & the abstract identifier of the time-slot within that day, together define the coordinates of a specific time-slot in the timetable.
  • Day/Time modules may already exist in the Haskell-platform's standard library, but since no account of; time-zones, locales, or leap-years, is required, they're undoubtedly over-engineered for the requirement.
Synopsis

Types

Type-synonyms

type TimeSet timeslotId = Set (Time timeslotId) Source #

An arbitrary set of Times.

type TimesByDay timeslotId = Map Day (Set timeslotId) Source #

Arbitrary times, categorised by day.

Data-types

data Time timeslotId Source #

Defines the coordinates of specific time-slot, within a given week.

Instances
Eq timeslotId => Eq (Time timeslotId) Source # 
Instance details

Defined in WeekDaze.Temporal.Time

Methods

(==) :: Time timeslotId -> Time timeslotId -> Bool #

(/=) :: Time timeslotId -> Time timeslotId -> Bool #

Ord timeslotId => Ord (Time timeslotId) Source # 
Instance details

Defined in WeekDaze.Temporal.Time

Methods

compare :: Time timeslotId -> Time timeslotId -> Ordering #

(<) :: Time timeslotId -> Time timeslotId -> Bool #

(<=) :: Time timeslotId -> Time timeslotId -> Bool #

(>) :: Time timeslotId -> Time timeslotId -> Bool #

(>=) :: Time timeslotId -> Time timeslotId -> Bool #

max :: Time timeslotId -> Time timeslotId -> Time timeslotId #

min :: Time timeslotId -> Time timeslotId -> Time timeslotId #

Read timeslotId => Read (Time timeslotId) Source # 
Instance details

Defined in WeekDaze.Temporal.Time

Methods

readsPrec :: Int -> ReadS (Time timeslotId) #

readList :: ReadS [Time timeslotId] #

readPrec :: ReadPrec (Time timeslotId) #

readListPrec :: ReadPrec [Time timeslotId] #

Show timeslotId => Show (Time timeslotId) Source # 
Instance details

Defined in WeekDaze.Temporal.Time

Methods

showsPrec :: Int -> Time timeslotId -> ShowS #

show :: Time timeslotId -> String #

showList :: [Time timeslotId] -> ShowS #

NFData timeslotId => NFData (Time timeslotId) Source # 
Instance details

Defined in WeekDaze.Temporal.Time

Methods

rnf :: Time timeslotId -> () #

XmlPickler timeslotId => XmlPickler (Time timeslotId) Source # 
Instance details

Defined in WeekDaze.Temporal.Time

Methods

xpickle :: PU (Time timeslotId) #

HTML timeslotId => HTML (Time timeslotId) Source # 
Instance details

Defined in WeekDaze.Temporal.Time

Methods

toHtml :: Time timeslotId -> Html #

toHtmlFromList :: [Time timeslotId] -> Html #

Constants

Functions

calculateNTimeslotsPerWeek :: NTimeslots -> NTimeslots Source #

Calculates the number of time-slots in a week, when provided by the number of time-slots per day.

calculateDistance :: Enum timeslotId => timeslotId -> timeslotId -> NTimeslots Source #

The signed distance between time-slots.

calculateAbsoluteDistance :: Enum timeslotId => timeslotId -> timeslotId -> NTimeslots Source #

The absolute distance between time-slots.

categoriseByDay :: Ord timeslotId => TimeSet timeslotId -> TimesByDay timeslotId Source #

  • Categorise the specified times, according to their day.
  • CAVEAT: some days have zero meetings, & therefore don't have a key in the resulting map.

shift :: Enum timeslotId => NTimeslots -> timeslotId -> timeslotId Source #

Shift the time-slot by the specified number of places.

shiftTime :: Enum timeslotId => NTimeslots -> Time timeslotId -> Time timeslotId Source #

Shift the time by the specified number of time-slots.

Constructors

mkTime :: Day -> timeslotId -> Time timeslotId Source #

Constructor.