Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Types for representing a number of days in a year.
Synopsis
- data Days (n :: Year)
- days :: forall a. DaysInYear a => Integer -> Days a
- daysAll :: forall a. DaysInYear a => Days a
- daysNone :: Days a
- getDays :: Days n -> Integer
- getFraction :: forall a frac. (DaysInYear a, Fractional frac) => Days a -> frac
- type DaysInYear = KnownNat
Documentation
days :: forall a. DaysInYear a => Integer -> Days a Source #
Construct a Days
value. If out of range, the number of days
is clamped to 0 or 365/366 (no runtime errors).
daysAll :: forall a. DaysInYear a => Days a Source #
Every day of the year
getDays :: Days n -> Integer Source #
Get the number of days, which is between 0 and 365/366 inclusive.
getFraction :: forall a frac. (DaysInYear a, Fractional frac) => Days a -> frac Source #
Get the number of days as a fractional value. Information about the the year type is discarded.
type DaysInYear = KnownNat Source #