Safe Haskell | None |
---|---|
Language | Haskell2010 |
AUTHOR
- Dr. Alistair Ward
DESCRIPTION
- Either the ideal time-slot in any day, or the specific set of times in each week, at which to book a lesson of a course.
- One may for example; prefer to teach a demanding course early, when concentration is relatively high; avoid swimming immediately after lunch; book games in a consecutive sequence of time-slots, during the afternoon.
- If there are fewer specified times, than there are lessons required per week for the course, then the remainder are booked at arbitrary times.
Synopsis
- data TimeslotRequest timeslotId
- = Ideally timeslotId
- | Specifically (TimeSet timeslotId)
- specificallyTag :: String
- countSpecifiedTimes :: TimeslotRequest timeslotId -> NTimeslots
- countSpecifiedDays :: TimeslotRequest timeslotId -> NDays
- getMaybeIdealTimeslotId :: TimeslotRequest timeslotId -> Maybe timeslotId
- getSpecifiedTimes :: TimeslotRequest timeslotId -> TimeSet timeslotId
- findDistinctRunlengthsOfSpecifiedTimes :: Enum timeslotId => TimeslotRequest timeslotId -> Set NTimeslots
- isIdeally :: TimeslotRequest timeslotId -> Bool
- isSpecific :: TimeslotRequest timeslotId -> Bool
- isNull :: TimeslotRequest timeslotId -> Bool
- isASpecifiedTime :: Ord timeslotId => Time timeslotId -> TimeslotRequest timeslotId -> Bool
- isASpecifiedDay :: Day -> TimeslotRequest timeslotId -> Bool
Types
Data-types
data TimeslotRequest timeslotId Source #
Defines the ideal time-slot on any day, or the specific times in each week, at which to book a lesson of a specific course.
Ideally timeslotId | Book as close to the specified time-slot as possible, but on an arbitrary day. |
Specifically (TimeSet timeslotId) | Book at the specified times in each week; any remaining lesson required for the course are booked at arbitrary times. |
Instances
Constants
specificallyTag :: String Source #
Used to qualify Output & XML.
Functions
countSpecifiedTimes :: TimeslotRequest timeslotId -> NTimeslots Source #
Counts the number of specified times.
countSpecifiedDays :: TimeslotRequest timeslotId -> NDays Source #
Counts the number of discrete days specified.
getMaybeIdealTimeslotId :: TimeslotRequest timeslotId -> Maybe timeslotId Source #
Accessor, which returns a default value for data constructed by Specifically
.
getSpecifiedTimes :: TimeslotRequest timeslotId -> TimeSet timeslotId Source #
Accessor, which returns a default value for data constructed by Ideally
.
findDistinctRunlengthsOfSpecifiedTimes :: Enum timeslotId => TimeslotRequest timeslotId -> Set NTimeslots Source #
Find the set of distinct run-lengths of consecutive specified times, occuring within any single day.
Predicates
isIdeally :: TimeslotRequest timeslotId -> Bool Source #
True when the timeslot-request was constructed by Ideally
.
isSpecific :: TimeslotRequest timeslotId -> Bool Source #
- True when the timeslot-request was constructed by
Specifically
- CAVEAT: the set of specified times may still be null.
isNull :: TimeslotRequest timeslotId -> Bool Source #
- True if there are zero specified times.
- CAVEAT: an ideal time-slot may still have been defined.
isASpecifiedTime :: Ord timeslotId => Time timeslotId -> TimeslotRequest timeslotId -> Bool Source #
True if the specified time is one of those requested.
isASpecifiedDay :: Day -> TimeslotRequest timeslotId -> Bool Source #
True if one of the specified times falls on the specified day.