Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Types and functions related to financial years.
Synopsis
- data Days (n :: Nat)
- days :: forall a. FinancialYear a => Integer -> Days a
- daysAll :: forall a. FinancialYear a => Days a
- daysNone :: Days a
- getDays :: Days n -> Integer
- getFraction :: forall a frac. (FinancialYear a, Fractional frac) => Days a -> frac
- type FinancialYear = KnownNat
- financialYear :: Day -> Year
- financialYearRange :: Year -> (Day, Day)
- financialYearRangeFromProxy :: forall n. FinancialYear n => Proxy n -> (Day, Day)
Documentation
Some number of days in a year. Use days
to construct.
days :: forall a. FinancialYear 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. FinancialYear 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. (FinancialYear a, Fractional frac) => Days a -> frac Source #
Get the number of days as a fractional value. The denominator is determined by the year type.
type FinancialYear = KnownNat Source #
financialYear :: Day -> Year Source #
The financial year in which the given day falls.
financialYearRange :: Year -> (Day, Day) Source #
Get the range of days (inclusive) for the financial year (July to June) ending in the given year.
financialYearRangeFromProxy :: forall n. FinancialYear n => Proxy n -> (Day, Day) Source #
Get the financial year range (inclusive) for the given type-level
financial year. See also financialYearRange
.