# Do your taxes with Haskell!

**URL:** <https://discourse.haskell.org/t/do-your-taxes-with-haskell/8942>\
**Category:** Announcements\
**Created:** [March 3, 2024, 2:36am UTC](https://discourse.haskell.org/t/do-your-taxes-with-haskell/8942 "2024-03-03T02:36:41Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![blamario](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.haskell.org/blamario/32/860_2.png) [@blamario](https://discourse.haskell.org/u/blamario)\
**Post date:** [March 3, 2024, 2:36am UTC](https://discourse.haskell.org/t/do-your-taxes-with-haskell/8942/1 "2024-03-03T02:36:41Z")

</div>

It’s that time of the year again, but now I got ready.

The last year’s [debut](http://discourse.haskell.org/t/a-command-line-application-written-in-haskell-for-canadian-taxes/6123) of the [canadian-income-tax](https://hackage.haskell.org/package/canadian-income-tax) package came rather late in the tax season, because I only realized it was possible when I went to do my own taxes. I had a year to prepare since then, so you can use the just-released version `2023.0` now, 2023 signifying the tax year it’s for. But it’s not only the tax year that’s different!

- I learned that different provinces’ T1 forms only _look_ the same, but are actually different PDFs with subtle differences in field coding carefully designed to make a programmer’s life miserable. My stubborn perfectionist streak made me handle them all. Every single province and territory. I hope there’s a Haskeller in Nunavut who can appreciate what I went through.
- The last year’s release supported the `428` provincial tax form only for Ontario. This year I added support for the `428` forms for Alberta, British Columbia, and Manitoba. Then I stopped. There’s a limit to everything.
- There’s also the `479` provincal tax credit form, for Ontario and British Columbia only.
- The federal schedule forms 6, 7, 9, and 11 are supported as well. Thankfully they’re the same for all provinces.
- Given a large number of possible options, the command line has been redesigned.
- I also added a tiny web server with interactive UI if that’s your thing.

So there you go Haskell-Canadians. You have no excuse to delay your tax returns any more.

---

<div class="post-metadata">

**Author:** ![Lsmor](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.haskell.org/lsmor/32/3302_2.png) [@Lsmor](https://discourse.haskell.org/u/Lsmor)\
**Post date:** [March 3, 2024, 10:09am UTC](https://discourse.haskell.org/t/do-your-taxes-with-haskell/8942/2 "2024-03-03T10:09:09Z")

</div>

I’d love to do the same with spanish taxes… But I think its complexity is beyond turing completeness

---

<div class="post-metadata">

**Author:** ![HeinrichApfelmus](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.haskell.org/heinrichapfelmus/32/117_2.png) [@HeinrichApfelmus](https://discourse.haskell.org/u/HeinrichApfelmus)\
**Post date:** [March 3, 2024, 11:07am UTC](https://discourse.haskell.org/t/do-your-taxes-with-haskell/8942/3 "2024-03-03T11:07:28Z")

</div>

> [@Lsmor](#):
>
> But I think its complexity is beyond turing completeness

I would not exclude the possibility that the situation is even worse — that the tax code is logically inconsistent; i.e. that you have to pay both, say, 30% tax and 32% tax _at the same time_.

---

<div class="post-metadata">

**Author:** ![blamario](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.haskell.org/blamario/32/860_2.png) [@blamario](https://discourse.haskell.org/u/blamario)\
**Post date:** [March 3, 2024, 11:46pm UTC](https://discourse.haskell.org/t/do-your-taxes-with-haskell/8942/4 "2024-03-03T23:46:20Z")

</div>

> [@HeinrichApfelmus](#):
>
> I would not exclude the possibility that the situation is even worse — that the tax code is logically inconsistent; i.e. that you have to pay both, say, 30% tax and 32% tax _at the same time_.

That’s why the project is limited to handle only the boring, deterministically computable parts of the tax return. The creative parts are up to the user. The breakthrough was when I realized that the two parts could be easily separated.

---

<div class="post-metadata">

**Author:** ![jameshaydon](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.haskell.org/jameshaydon/32/3336_2.png) [@jameshaydon](https://discourse.haskell.org/u/jameshaydon)\
**Post date:** [March 4, 2024, 6:42am UTC](https://discourse.haskell.org/t/do-your-taxes-with-haskell/8942/5 "2024-03-04T06:42:47Z")

</div>

> [@HeinrichApfelmus](#):
>
> would not exclude the possibility that the situation is even worse — that the tax code is logically inconsistent

People might be interested in the fact that a significant chunk of the french tax code has been [formalised in Catala](https://catala-lang.org/en/ir-catala), and some of the [US tax code](https://catala-lang.org/en/examples/us-tax-code) too.

---

<div class="post-metadata">

**Author:** ![olf](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.haskell.org/olf/32/3813_2.png) [@olf](https://discourse.haskell.org/u/olf)\
**Post date:** [March 5, 2024, 10:16pm UTC](https://discourse.haskell.org/t/do-your-taxes-with-haskell/8942/6 "2024-03-05T22:16:53Z")

</div>

Over here in Germany, we’ve been doing our taxes with Haskell since 2020. Henning Thielemann has been helping us to file a particular type of tax in Germany that is provably unsolvable (a huge system of linear equations with more unknowns than equations, but the tax depends on the solution) and has released a number of Haskell packages during development. He even found and reported bugs in upstream C libraries he was writing FFI bindings for. It was fun to find the minimal example where the tax problem becomes underspecified. The ministry of economics has been informed, but strangely they don’t seem to want to know their law is defunct.

---

<div class="post-metadata">

**Author:** ![blamario](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.haskell.org/blamario/32/860_2.png) [@blamario](https://discourse.haskell.org/u/blamario)\
**Post date:** [March 11, 2024, 2:32am UTC](https://discourse.haskell.org/t/do-your-taxes-with-haskell/8942/7 "2024-03-11T02:32:53Z")

</div>

## Public Service Announcement

I have started hosting the service at [taxell.ca](http://taxell.ca/) for anybody who could use it but couldn’t build and install the project from source.

---

<div class="post-metadata">

**Author:** ![frasertweedale](https://sea2.discourse-cdn.com/flex002/user_avatar/discourse.haskell.org/frasertweedale/32/2418_2.png) [@frasertweedale](https://discourse.haskell.org/u/frasertweedale)\
**Post date:** [March 12, 2024, 12:38pm UTC](https://discourse.haskell.org/t/do-your-taxes-with-haskell/8942/8 "2024-03-12T12:38:31Z")

</div>

While we’re at it, here’s my _tax-ato_ library for Australian individual income taxes: [Data.Tax.ATO](https://hackage.haskell.org/package/tax-ato/docs/Data-Tax-ATO.html).

You can’t use it to _submit_ your tax return (perhaps one day…), but I find it useful for estimating and preparing my taxes. It is far from complete and has some known bugs. If you are interested to try it out but hit a gap, please file an issue or send a PR. I plan to continue improving and extending (and better documenting!) the library over time.

---

<div class="post-metadata">

**Author:** ![thielema](https://avatars.discourse-cdn.com/v4/letter/t/ee59a6/32.png) [@thielema](https://discourse.haskell.org/u/thielema)\
**Post date:** [October 26, 2024, 3:32pm UTC](https://discourse.haskell.org/t/do-your-taxes-with-haskell/8942/9 "2024-10-26T15:32:21Z")

</div>

I am using Hledger and Hledger-Web for bookkeeping and tax declaration. Recently added some FODS export for post-processing data from Hledger in LibreOffice-Calc.
