weekdaze- A school-timetable problem-solver.

Safe HaskellNone




Dr. Alistair Ward
  • Defines the personal timetable for any week, for each location.
  • It contains identical information to Timetable, but the data has been re-indexed to present it in a form relevant to a location rather than a student.



type Timetable locationId timeslotId teacherId level = Timetable locationId timeslotId (LessonResourceIds teacherId) level Source #

An association-list of the timetables for all locations.




fromStudentViewTimetable Source #


:: (Ix timeslotId, Enum timeslotId, Eq level, Eq teacherId, Ord locationId, Show level, Show locationId, Show teacherId, Show timeslotId) 
=> Bool

Permit a temporary student-body merger.

-> Timetable locationId timeslotId teacherId level

An unallocated timetable, supplied for efficiency.

-> Timetable timeslotId locationId teacherId level 
-> Timetable locationId timeslotId teacherId level 
  • Build a Timetable by inverting a Timetable.
  • CAVEAT: in the original Timetable, different student-bodies may simultaneously reference a single location. This is normal behaviour, provided the location has sufficient capacity, & is implemented seemlessly, as a map-structure with one or more keys referencing a value, containing the same location.
  • When inverting such a timetable, this many-to-one relationship becomes a one-to-many, & a single location-id must now reference many student-bodies. The map-structure (cf. multi-map), can't directly accommodate multiple identical keys, with different values, so this is achieved by merging the student-bodies into a class of students.

toStudentViewTimetable Source #


:: (Ix timeslotId, Enum timeslotId) 
=> Timetable timeslotId locationId teacherId level

An unallocated timetable, supplied for efficiency.

-> Timetable locationId timeslotId teacherId level 
-> Timetable timeslotId locationId teacherId level 
  • Build a Timetable, by inverting a Timetable.
  • Each lesson in the timetable seen from the location's perspective, contains a student-class. This student-class must be broken into student-bodies, before inserting repeatedly into the required timetable as seen from the student-body's perpective.

toXHtml Source #


:: (Ix timeslotId, Fractional minimumContrastRatio, Ord level, Ord locationId, Ord minimumContrastRatio, Ord teacherId, Show level, Show teacherId, HTML campus, HTML level, HTML locationId, HTML synchronisationId, HTML teacherId, HTML timeslotId) 
=> (locationId -> Lesson teacherId level -> Course synchronisationId level timeslotId)

Find the course to which the specified lesson belongs.

-> LocationCatalogue locationId campus 
-> GenericTimetableToMarkup locationId minimumContrastRatio teacherId timeslotId (Timetable locationId timeslotId teacherId level) 

Render in XHTML, as a definition-list.