Safe Haskell | Safe |
---|---|
Language | Haskell2010 |
Dates are used in Euler problem 19.
Synopsis
- monthLength :: Int -> Int -> Int
- monthLengths :: Int -> [Int]
- yearLength :: Int -> Int
- leap :: Int -> Bool
Functions
monthLength :: Int -> Int -> Int Source #
is the number of days in month monthLength
y mm
of year y
.
monthLengths :: Int -> [Int] Source #
yearLength :: Int -> Int Source #
The number of days in a year AD.
Whether a year AD is a leap year. Leap years contain an extra day in February.
Properties
The length of a year is equal to the sum of the lengths of its months.
yearLength y == sum (monthLengths y)