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

Safe HaskellNone
LanguageHaskell2010

WeekDaze.Temporal.Availability

Contents

Description

AUTHOR
Dr. Alistair Ward
DESCRIPTION

Describes the availability of some resource.

CAVEAT
  • Availability, as defined here, can only be defined for each whole day in any unspecified week, rather than individual time-slots within a day, or sporadic days in the year. This restriction isn't conceptual, but merely for the tractability of the code.
  • Resources available for only part of a day, can't be directly accommodated.
Synopsis

Types

Data-types

Constants

tag :: String Source #

Used to qualify SQL & XML.

Functions

calculateAvailabilityRatio :: Fractional f => Availability -> f Source #

Returns the ratio of the available portion of the week, to the whole week (including weekends).

countDaysPerWeekAvailable :: Availability -> NDays Source #

The number of days per week, which can be considered available.

countInternalAvailabilityGaps :: Availability -> NDays Source #

Counts non-terminal blocks of consecutive unavailable days.

findIntersection :: Availability -> Availability -> Availability Source #

Returns the days on which both resources are available.

findIntersections :: Foldable foldable => foldable Availability -> Availability Source #

Returns the days on which all the specified resources are available.

findUnions :: Foldable foldable => foldable Availability -> Availability Source #

Returns the days on which any of the specified resources is available.

Constructor

mkAvailability :: [Day] -> Availability Source #

  • Smart constructor.
  • Prevents one directly constructing an unavailable resource, though one can indirectly as a result of an operation which returns a new one; e.g. findIntersection.

Predicates

isFulltime :: Availability -> Bool Source #

True if the resource is available every day.

isUnavailable :: Availability -> Bool Source #

isAvailableOn :: Day -> Availability -> Bool Source #

True if the unspecified resource is available on the specified day.