cost-per-decade: Buy-it-for-life math: cost per decade and break-even years

[ library, math, mit ] [ Propose Tags ] [ Report a vulnerability ]

Sticker price compares badly across lifespans: a cheap item replaced every couple of years outruns a durable one that lasts decades. These functions spread each price over the decades it buys, price a single use, count the units a horizon needs, and find the first year the cheap stack has spent as much as the durable one. A warranty-coverage verdict rounds it out.

Companion to Durable Picks, which ranks gear by cost-per-decade math. Five pure functions, no dependencies beyond base.


[Skip to Readme]

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

  • No Candidates
Versions [RSS] 0.1.0
Change log CHANGELOG.md
Dependencies base (>=4 && <5) [details]
License MIT
Copyright 2026 Poket Dev LLC
Author Poket Dev
Maintainer hello@poketdev.com
Uploaded by PoketDev at 2026-11-02T02:05:36Z
Category Math
Home page https://www.durablepicks.com
Bug tracker https://github.com/scrapertweeter3-prog/cost-per-decade-hs/issues
Source repo head: git clone https://github.com/scrapertweeter3-prog/cost-per-decade-hs
Distributions
Downloads 3 total (3 in the last 30 days)
Rating (no votes yet) [estimated by Bayesian average]
Your Rating
  • λ
  • λ
  • λ
Status Docs available [build log]
Last success reported on 2026-11-02 [all 1 reports]

Readme for cost-per-decade-0.1.0

[back to package description]

cost-per-decade

Buy-it-for-life arithmetic: cost per decade, cost per use, and the year the cheap option stops being the bargain.

Sticker price is a bad comparator when lifespans differ. A $40 item replaced every two years outruns a $280 item that lasts twenty: $140 per decade against $200, and the forty-dollar stack needs fifteen units to cover thirty years.

The package follows the cost-per-decade method used on Durable Picks. It depends only on base.

Example

A $280 durable item with a 20-year expected life, a $40 alternative that lasts 2 years, a 25-year warranty, and 150 uses a year:

  • cost per decade: costPerDecade 280 20 = $140.00
  • cost per use: costPerUse 280 20 150 = $0.0933
  • warranty: warrantyClass 25 20 = covered for life (25y warranty on 20y expected life)
  • 30-year horizon: durable = 2 purchases, $560 total; cheap = 15 purchases, $600 total
  • break-even: breakEvenYear 280 20 40 2 30 = year 12

The cheap stack hits $280 at year 12, the same year it takes its seventh unit. From there the durable option saves $40 across the thirty-year window, and the warranty outlives the item instead of covering a fraction of it.