Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Types and computations for taxes in Australia.
No guarantee that computations are correct, complete or current.
Lots of things are not implemented, including (but not limited to): ETPs, income from partnerships and trusts, superannuation income streams and lump payments, tax losses from previous years, Medicare levy reduction/exemption, adjustments, and variations based on family income and dependents.
Synopsis
- data TaxReturnInfo y a
- newTaxReturnInfo :: (DaysInYear y, Num a) => TaxReturnInfo y a
- newTaxReturnInfoForTables :: (DaysInYear y, Num a) => TaxTables y a -> TaxReturnInfo y a
- income :: HasIncome a b c => Getter (a b) (Money c)
- data PaymentSummary a = PaymentSummary {}
- paymentSummaries :: Lens' (TaxReturnInfo y a) [PaymentSummary a]
- type ABN = String
- interest :: Lens' (TaxReturnInfo y a) (GrossAndWithheld a)
- data Dividend a = Dividend {}
- dividends :: Lens' (TaxReturnInfo y a) [Dividend a]
- dividendFrankingCredit :: RealFrac a => Dividend a -> Money a
- class HasCapitalLossCarryForward a b where
- capitalLossCarryForward :: Lens' (a b) (Money b)
- cgtEvents :: Lens' (TaxReturnInfo y a) [CGTEvent a]
- data ESSStatement a
- newESSStatement :: Num a => ESSStatement a
- ess :: Lens' (TaxReturnInfo y a) (ESSStatement a)
- essTaxedUpfrontReduction :: Lens' (ESSStatement a) (Money a)
- essTaxedUpfrontNoReduction :: Lens' (ESSStatement a) (Money a)
- essDeferral :: Lens' (ESSStatement a) (Money a)
- essPre2009 :: Lens' (ESSStatement a) (Money a)
- essTFNAmounts :: Lens' (ESSStatement a) (Money a)
- essForeignSourceDiscounts :: Lens' (ESSStatement a) (Money a)
- foreignIncome :: Lens' (TaxReturnInfo y a) (Money a)
- mlsExemption :: Lens' (TaxReturnInfo y a) (Days y)
- privateHealthInsurancePolicyDetails :: Lens' (TaxReturnInfo y a) [PrivateHealthInsurancePolicyDetail a]
- helpBalance :: Lens' (TaxReturnInfo y a) (Money a)
- sfssBalance :: Lens' (TaxReturnInfo y a) (Money a)
- data SpouseDetails a
- spouseDetails :: Lens' (TaxReturnInfo y a) (Maybe (SpouseDetails a))
- newSpouseDetails :: Num a => SpouseDetails a
- spouseTaxableIncome :: Lens' (SpouseDetails a) (Money a)
- data IncomeTests a
- incomeTests :: Lens' (TaxReturnInfo y a) (IncomeTests a)
- newIncomeTests :: Num a => IncomeTests a
- taxFreeGovernmentPensionsOrBenefits :: Lens' (IncomeTests a) (Money a)
- targetForeignIncome :: Lens' (IncomeTests a) (Money a)
- childSupportPaid :: Lens' (IncomeTests a) (Money a)
- dependentChildren :: Lens' (IncomeTests a) Integer
- data Deductions a
- deductions :: Lens' (TaxReturnInfo y a) (Deductions a)
- totalDeductions :: (Num a, Ord a) => Deductions a -> Money a
- workRelatedCarExpenses :: Lens' (Deductions a) (Money a)
- workRelatedTravelExpenses :: Lens' (Deductions a) (Money a)
- workRelatedClothingLaundryAndDryCleaningExpenses :: Lens' (Deductions a) (Money a)
- workRelatedSelfEducationExpenses :: Lens' (Deductions a) (Money a)
- otherWorkRelatedExpenses :: Lens' (Deductions a) (Money a)
- lowValuePoolDeduction :: Lens' (Deductions a) (Money a)
- interestDeductions :: Lens' (Deductions a) (Money a)
- dividendDeductions :: Lens' (Deductions a) (Money a)
- giftsOrDonations :: Lens' (Deductions a) (Money a)
- costOfManagingTaxAffairs :: Lens' (Deductions a) (Money a)
- deductibleAmountOfUndeductedPurchasePriceOfAForeignPensionOrAnnuity :: Lens' (Deductions a) (Money a)
- personalSuperannuationContributions :: Lens' (Deductions a) (Money a)
- deductionForProjectPool :: Lens' (Deductions a) (Money a)
- forestryManagedInvestmentSchemeDeduction :: Lens' (Deductions a) (Money a)
- otherDeductions :: Lens' (Deductions a) (Money a)
- foreignIncomeDeductions :: Lens' (Deductions a) (Money a)
- data Offsets a
- offsets :: Lens' (TaxReturnInfo y a) (Offsets a)
- spouseContributionOffset :: Lens' (Offsets a) (Money a)
- foreignTaxOffset :: Lens' (Offsets a) (Money a)
- paygInstalments :: Lens' (Offsets a) (Money a)
- data TaxAssessment a
- assessTax :: (DaysInYear y, RealFrac a) => TaxTables y a -> TaxReturnInfo y a -> TaxAssessment a
- taxBalance :: Num a => Getter (TaxAssessment a) (Money a)
- taxDue :: Getter (TaxAssessment a) (Money a)
- medicareLevyDue :: Getter (TaxAssessment a) (Money a)
- taxCreditsAndOffsets :: Getter (TaxAssessment a) (Money a)
- taxCGTAssessment :: Lens' (TaxAssessment a) (CGTAssessment a)
- privateHealthInsuranceRebateAdjustment :: Lens' (TaxAssessment a) (Money a)
- corporateTax :: Fractional a => Tax (Money a) (Money a)
- data GrossAndWithheld a = GrossAndWithheld (Money a) (Money a)
- class HasTaxWithheld a b c where
- taxWithheld :: Getter (a b) (Money c)
- data Proportion a
- getProportion :: Proportion a -> a
- proportion :: (Ord a, Num a) => a -> Proportion a
- module Data.Tax
- module Data.Tax.ATO.PrivateHealthInsuranceRebate
- module Data.Tax.ATO.Rounding
Individual tax returns
data TaxReturnInfo y a Source #
Individual tax return information.
Use newTaxReturnInfo
to construct. Alternatively,
newTaxReturnInfoForTables
can be used to coerce the type
parameters to be the same as some TaxTables
.
The following lenses are available:
mlsExemption | Medicare levy exemption |
helpBalance | HELP account balance |
sfssBalance | SFSS account balance |
paymentSummaries | PAYG payment summaries |
interest | Interest data |
dividends | Dividend data |
ess | Employee Share Scheme statement |
foreignIncome | Foreign income |
cgtEvents | Capital gains and losses |
deductions | Deductions |
offsets | Tax offsets |
privateHealthInsurancePolicyDetails
| Private health insurance policy details |
spouseDetails | Spouse Details (or Nothing ) |
incomeTests | Income Tests |
Instances
Num a => HasTaxWithheld (TaxReturnInfo y :: Type -> Type) (a :: Type) a Source # | |
Defined in Data.Tax.ATO taxWithheld :: Getter (TaxReturnInfo y a) (Money a) Source # | |
RealFrac a => HasIncome (TaxReturnInfo y :: Type -> Type) (a :: Type) a Source # | Taxable income |
Defined in Data.Tax.ATO | |
HasCapitalLossCarryForward (TaxReturnInfo y) a Source # | |
Defined in Data.Tax.ATO capitalLossCarryForward :: Lens' (TaxReturnInfo y a) (Money a) Source # |
newTaxReturnInfo :: (DaysInYear y, Num a) => TaxReturnInfo y a Source #
Construct a new TaxReturnInfo
.
All monetary fields and lists are initially empty.
The Medicare levy surcharge exemption field is initially set to the number of days in the year (i.e. the taxpayer is fully exempt).
newTaxReturnInfoForTables :: (DaysInYear y, Num a) => TaxTables y a -> TaxReturnInfo y a Source #
Construct a TaxReturnInfo
per newTaxReturnInfo
,
coercing the type parameters to match the TaxTables
argument (which is ignored).
Income
PAYG Payment Summaries
data PaymentSummary a Source #
PAYG payment summary - individual non-business
PaymentSummary | |
|
Instances
HasTaxWithheld PaymentSummary (a :: Type) a Source # | |
Defined in Data.Tax.ATO taxWithheld :: Getter (PaymentSummary a) (Money a) Source # | |
HasIncome PaymentSummary (a :: Type) a Source # | Gross income |
Defined in Data.Tax.ATO |
paymentSummaries :: Lens' (TaxReturnInfo y a) [PaymentSummary a] Source #
Interest
interest :: Lens' (TaxReturnInfo y a) (GrossAndWithheld a) Source #
Dividends and franking credits
Dividend payment. Records net income, franked portion and amount of tax withheld.
Dividend | |
|
dividendFrankingCredit :: RealFrac a => Dividend a -> Money a Source #
Calculate the franking credit for a dividend
Capital gains tax (CGT)
class HasCapitalLossCarryForward a b where Source #
Types that have a carry-forward capital loss (either as an input or an output).
capitalLossCarryForward :: Lens' (a b) (Money b) Source #
Instances
(Num a, Eq a) => HasCapitalLossCarryForward TaxAssessment a Source # | |
Defined in Data.Tax.ATO capitalLossCarryForward :: Lens' (TaxAssessment a) (Money a) Source # | |
(Num a, Eq a) => HasCapitalLossCarryForward CGTAssessment a Source # | |
Defined in Data.Tax.ATO.CGT capitalLossCarryForward :: Lens' (CGTAssessment a) (Money a) Source # | |
(Num a, Eq a) => HasCapitalLossCarryForward CGTNetGainOrLoss a Source # | |
Defined in Data.Tax.ATO.CGT capitalLossCarryForward :: Lens' (CGTNetGainOrLoss a) (Money a) Source # | |
HasCapitalLossCarryForward (TaxReturnInfo y) a Source # | |
Defined in Data.Tax.ATO capitalLossCarryForward :: Lens' (TaxReturnInfo y a) (Money a) Source # |
Employee share schemes
data ESSStatement a Source #
Employee share scheme statement. Use newESSStatement
to construct.
Instances
Num a => HasIncome ESSStatement (a :: Type) a Source # | Note: does not implement the reduction of taxed up front amounts eligible for reduction. |
Defined in Data.Tax.ATO | |
Num a => Monoid (ESSStatement a) Source # | |
Defined in Data.Tax.ATO mempty :: ESSStatement a # mappend :: ESSStatement a -> ESSStatement a -> ESSStatement a # mconcat :: [ESSStatement a] -> ESSStatement a # | |
Num a => Semigroup (ESSStatement a) Source # | |
Defined in Data.Tax.ATO (<>) :: ESSStatement a -> ESSStatement a -> ESSStatement a # sconcat :: NonEmpty (ESSStatement a) -> ESSStatement a # stimes :: Integral b => b -> ESSStatement a -> ESSStatement a # |
newESSStatement :: Num a => ESSStatement a Source #
Construct an ESSStatement
with all amounts at zero.
ess :: Lens' (TaxReturnInfo y a) (ESSStatement a) Source #
essTaxedUpfrontReduction :: Lens' (ESSStatement a) (Money a) Source #
Discount from taxed up front schemes—eligible for reduction. Item D in Employee share schemes section.
essTaxedUpfrontNoReduction :: Lens' (ESSStatement a) (Money a) Source #
Discount from taxed up front schemes—not eligible for reduction Item E in Employee share schemes section.
essDeferral :: Lens' (ESSStatement a) (Money a) Source #
Discount from taxed deferral schemes. Item F in Employee share schemes section.
essPre2009 :: Lens' (ESSStatement a) (Money a) Source #
discounts on ESS interests acquired pre 1 July 2009 and "cessation time" occurred during the finanical year. Item G in Employee share schemes section.
essTFNAmounts :: Lens' (ESSStatement a) (Money a) Source #
TFN amounts withheld from discounts. Item C in Employee share schemes section.
essForeignSourceDiscounts :: Lens' (ESSStatement a) (Money a) Source #
ESS foreign source discounts Item A in Employee share schemes section.
Foreign income
foreignIncome :: Lens' (TaxReturnInfo y a) (Money a) Source #
Medicare Levy Surcharge and Private Health Insurance
mlsExemption :: Lens' (TaxReturnInfo y a) (Days y) Source #
privateHealthInsurancePolicyDetails :: Lens' (TaxReturnInfo y a) [PrivateHealthInsurancePolicyDetail a] Source #
Student loan balances
helpBalance :: Lens' (TaxReturnInfo y a) (Money a) Source #
sfssBalance :: Lens' (TaxReturnInfo y a) (Money a) Source #
Spouse details
data SpouseDetails a Source #
spouseDetails :: Lens' (TaxReturnInfo y a) (Maybe (SpouseDetails a)) Source #
newSpouseDetails :: Num a => SpouseDetails a Source #
spouseTaxableIncome :: Lens' (SpouseDetails a) (Money a) Source #
Income Tests
data IncomeTests a Source #
incomeTests :: Lens' (TaxReturnInfo y a) (IncomeTests a) Source #
newIncomeTests :: Num a => IncomeTests a Source #
taxFreeGovernmentPensionsOrBenefits :: Lens' (IncomeTests a) (Money a) Source #
targetForeignIncome :: Lens' (IncomeTests a) (Money a) Source #
childSupportPaid :: Lens' (IncomeTests a) (Money a) Source #
dependentChildren :: Lens' (IncomeTests a) Integer Source #
Deductions
data Deductions a Source #
Deductions that individuals can claim.
The only "special case" field is foreignIncomeDeductions
, which is
the aggregate amount of other deductions that pertains to foreign
income. It is used only for calculating the Foreign Income Tax Offset
Limit.
Instances
Num a => Monoid (Deductions a) Source # | |
Defined in Data.Tax.ATO mempty :: Deductions a # mappend :: Deductions a -> Deductions a -> Deductions a # mconcat :: [Deductions a] -> Deductions a # | |
Num a => Semigroup (Deductions a) Source # | |
Defined in Data.Tax.ATO (<>) :: Deductions a -> Deductions a -> Deductions a # sconcat :: NonEmpty (Deductions a) -> Deductions a # stimes :: Integral b => b -> Deductions a -> Deductions a # |
deductions :: Lens' (TaxReturnInfo y a) (Deductions a) Source #
totalDeductions :: (Num a, Ord a) => Deductions a -> Money a Source #
Sum the deductions. Negative components are ignored.
workRelatedCarExpenses :: Lens' (Deductions a) (Money a) Source #
D1 Work-related car expenses
workRelatedTravelExpenses :: Lens' (Deductions a) (Money a) Source #
D2 Work-related travel expenses
workRelatedClothingLaundryAndDryCleaningExpenses :: Lens' (Deductions a) (Money a) Source #
D3 Work-related clothing, laundry and dry-cleaning expenses
workRelatedSelfEducationExpenses :: Lens' (Deductions a) (Money a) Source #
D4 Work-related self-education expenses
otherWorkRelatedExpenses :: Lens' (Deductions a) (Money a) Source #
D5 Other work-related expenses
lowValuePoolDeduction :: Lens' (Deductions a) (Money a) Source #
D6 Low-value pool deduction
interestDeductions :: Lens' (Deductions a) (Money a) Source #
D7 Interest deductions
dividendDeductions :: Lens' (Deductions a) (Money a) Source #
D8 Dividend deductions
giftsOrDonations :: Lens' (Deductions a) (Money a) Source #
D9 Gifts or donations
costOfManagingTaxAffairs :: Lens' (Deductions a) (Money a) Source #
D10 Cost of managing tax affairs
deductibleAmountOfUndeductedPurchasePriceOfAForeignPensionOrAnnuity :: Lens' (Deductions a) (Money a) Source #
D11 Deductible amount of undeducted purchase price of a foreign pension or annuity
personalSuperannuationContributions :: Lens' (Deductions a) (Money a) Source #
D12 Personal superannuation contributions
deductionForProjectPool :: Lens' (Deductions a) (Money a) Source #
D13 Deduction for project pool
forestryManagedInvestmentSchemeDeduction :: Lens' (Deductions a) (Money a) Source #
D14 Forestry managed investment scheme deduction
otherDeductions :: Lens' (Deductions a) (Money a) Source #
D15 Other deductions — not claimable at D1 to D14 or elsewhere in your tax return
foreignIncomeDeductions :: Lens' (Deductions a) (Money a) Source #
Aggregate of deductions related to foreign income, including:
- Deductions that are reasonably related to amounts on which foreign income tax has been paid
- Debt deductions attributable to your overseas permanent establishment
- Amount of the foreign loss component of one or more tax losses deducted in the income year.
The components making up this amount must be included in other fields. This field is only used in calculating the Foreign Income Tax Offset Limit.
Tax offsets
Tax offsets that individuals can claim
The following lenses are available:
spouseContributionOffset | Spouse super contribution |
foreignTaxOffset | Foreign income tax offset |
paygInstalments | PAYG Instalments |
spouseContributionOffset :: Lens' (Offsets a) (Money a) Source #
Spouse contribution offset. Maximum of $540 (not enforced).
Assessing tax
data TaxAssessment a Source #
A tax assessment. Use assessTax
to compute a
TaxAssessment
.
Instances
(Num a, Eq a) => HasCapitalLossCarryForward TaxAssessment a Source # | |
Defined in Data.Tax.ATO capitalLossCarryForward :: Lens' (TaxAssessment a) (Money a) Source # | |
HasTaxWithheld TaxAssessment (a :: Type) a Source # | |
Defined in Data.Tax.ATO taxWithheld :: Getter (TaxAssessment a) (Money a) Source # | |
HasIncome TaxAssessment (a :: Type) a Source # | Taxable income |
Defined in Data.Tax.ATO |
assessTax :: (DaysInYear y, RealFrac a) => TaxTables y a -> TaxReturnInfo y a -> TaxAssessment a Source #
Assess a tax return, given tax tables and tax return info.
taxBalance :: Num a => Getter (TaxAssessment a) (Money a) Source #
What is the balance of the assessment? Positive means a refund (tax withheld exceeds obligation), negative means a bill.
medicareLevyDue :: Getter (TaxAssessment a) (Money a) Source #
taxCreditsAndOffsets :: Getter (TaxAssessment a) (Money a) Source #
taxCGTAssessment :: Lens' (TaxAssessment a) (CGTAssessment a) Source #
Corporate tax
corporateTax :: Fractional a => Tax (Money a) (Money a) Source #
The corporate tax rate of 30%. In the future, different rates may be levied depending on business turnover/income.
Miscellaneous
data GrossAndWithheld a Source #
A gross income (first argument) and amount of tax withheld (second argument)
GrossAndWithheld (Money a) (Money a) |
Instances
HasTaxWithheld GrossAndWithheld (a :: Type) a Source # | |
Defined in Data.Tax.ATO taxWithheld :: Getter (GrossAndWithheld a) (Money a) Source # | |
HasIncome GrossAndWithheld (a :: Type) a Source # | |
Defined in Data.Tax.ATO | |
Num a => Monoid (GrossAndWithheld a) Source # | |
Defined in Data.Tax.ATO mempty :: GrossAndWithheld a # mappend :: GrossAndWithheld a -> GrossAndWithheld a -> GrossAndWithheld a # mconcat :: [GrossAndWithheld a] -> GrossAndWithheld a # | |
Num a => Semigroup (GrossAndWithheld a) Source # | |
Defined in Data.Tax.ATO (<>) :: GrossAndWithheld a -> GrossAndWithheld a -> GrossAndWithheld a # sconcat :: NonEmpty (GrossAndWithheld a) -> GrossAndWithheld a # stimes :: Integral b => b -> GrossAndWithheld a -> GrossAndWithheld a # |
class HasTaxWithheld a b c where Source #
Data that can have an amount of tax withheld
taxWithheld :: Getter (a b) (Money c) Source #
Instances
RealFrac a => HasTaxWithheld Dividend (a :: Type) a Source # | |
Defined in Data.Tax.ATO | |
HasTaxWithheld GrossAndWithheld (a :: Type) a Source # | |
Defined in Data.Tax.ATO taxWithheld :: Getter (GrossAndWithheld a) (Money a) Source # | |
HasTaxWithheld PaymentSummary (a :: Type) a Source # | |
Defined in Data.Tax.ATO taxWithheld :: Getter (PaymentSummary a) (Money a) Source # | |
HasTaxWithheld TaxAssessment (a :: Type) a Source # | |
Defined in Data.Tax.ATO taxWithheld :: Getter (TaxAssessment a) (Money a) Source # | |
Num a => HasTaxWithheld (TaxReturnInfo y :: Type -> Type) (a :: Type) a Source # | |
Defined in Data.Tax.ATO taxWithheld :: Getter (TaxReturnInfo y a) (Money a) Source # | |
(Foldable t, HasTaxWithheld x a a, Num a) => HasTaxWithheld (t :: TYPE LiftedRep -> Type) (x a :: TYPE LiftedRep) a Source # | |
Defined in Data.Tax.ATO taxWithheld :: Getter (t (x a)) (Money a) Source # |
data Proportion a Source #
A proportion is a non-negative number in interval [0,1]
.
Use proportion
to construct.
Instances
Show a => Show (Proportion a) Source # | |
Defined in Data.Tax.ATO showsPrec :: Int -> Proportion a -> ShowS # show :: Proportion a -> String # showList :: [Proportion a] -> ShowS # | |
Eq a => Eq (Proportion a) Source # | |
Defined in Data.Tax.ATO (==) :: Proportion a -> Proportion a -> Bool # (/=) :: Proportion a -> Proportion a -> Bool # | |
Ord a => Ord (Proportion a) Source # | |
Defined in Data.Tax.ATO compare :: Proportion a -> Proportion a -> Ordering # (<) :: Proportion a -> Proportion a -> Bool # (<=) :: Proportion a -> Proportion a -> Bool # (>) :: Proportion a -> Proportion a -> Bool # (>=) :: Proportion a -> Proportion a -> Bool # max :: Proportion a -> Proportion a -> Proportion a # min :: Proportion a -> Proportion a -> Proportion a # |
getProportion :: Proportion a -> a Source #
Return underlying figure, which is in interval [0,1]
proportion :: (Ord a, Num a) => a -> Proportion a Source #
Construct a proportion. Out of range numbers are clamped
to 0
or 1
(no runtime errors).
module Data.Tax
module Data.Tax.ATO.Rounding