Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Reasonably efficient (constant-time) calculation of standard bank holidays in England and Wales, including special cases 1995-2014. May become out-of-date as future special cases are announced.
- bankHolidays :: Integer -> [Day]
- isBankHoliday :: Day -> Bool
- countBankHolidays :: Day -> Day -> Integer
Documentation
bankHolidays :: Integer -> [Day] Source
List the bank holidays for the given year, in ascending order. Bank holidays never fall on a weekend.
isBankHoliday :: Day -> Bool Source
Returns whether a day is a bank holiday.
countBankHolidays :: Day -> Day -> Integer Source
Count the number of bank holidays between two Day
s.
If d0 <= d1
then countBankHolidays d0 d1
is the number of Day
s d
for
which isBankHoliday d && d0 <= d && d < d1
. Note the count includes d0
but
excludes d1
.
Additionally, countBankHolidays d0 d1 == negate (countBankHolidays d1 d0)
and
countBankHolidays d0 d2 == countBankHolidays d0 d1 + countBankHolidays d1 d2
.