betacalendars-calendar-layout: Pure calendar-grid topology and physical print-layout algebra

[ data, library, mit, program, time ] [ Propose Tags ] [ Report a vulnerability ]

A deterministic Haskell library for Gregorian month topology, all seven week origins, natural and fixed six-week grids, undated planning grids, paper geometry, and structured validation.


[Skip to Readme]

Downloads

Maintainer's Corner

Package maintainers

For package maintainers and hackage trustees

Candidates

  • No Candidates
Versions [RSS] 0.1.0.0
Change log CHANGELOG.md
Dependencies base (>=4.16 && <5), betacalendars-calendar-layout, time (>=1.11 && <2) [details]
License MIT
Author Mateo Pedersen
Maintainer betamateopedersen@gmail.com
Uploaded by mateopedersen at 2026-10-07T16:45:52Z
Category Data, Time
Home page https://www.betacalendars.com/
Bug tracker https://github.com/mateopedersen/haskell-betacalendars-calendar-layout/issues
Source repo head: git clone https://github.com/mateopedersen/haskell-betacalendars-calendar-layout
this: git clone https://github.com/mateopedersen/haskell-betacalendars-calendar-layout(tag v0.1.0.0)
Distributions
Executables example-blank, example-paper, example-basic
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-10-07 [all 1 reports]

Readme for betacalendars-calendar-layout-0.1.0.0

[back to package description]

BetaCalendars Calendar Layout Algebra

betacalendars-calendar-layout is a pure Haskell library for deterministic Gregorian month topology, seven week origins, natural and fixed six-week grids, undated planning grids, and physical print-layout measurements. It is useful without any BetaCalendars service and performs no network access.

Install

Add the package to a Cabal project:

build-depends: betacalendars-calendar-layout

The runtime dependency surface is intentionally small: base and time.

Quick start

import BetaCalendars.CalendarLayout

januaryTopology :: MonthTopology
januaryTopology = monthTopology (Year 2027) January MondayStart

sundayJanuary :: MonthGrid
sundayJanuary = buildMonthGrid
  (Year 2027) January SundayStart FixedSixWeeks IncludeAdjacentDates

NaturalRows uses the actual four-to-six row month shape. FixedSixWeeks always contains exactly 42 cells. Set BlankAdjacentCells to keep adjacent dates out of the visible grid while retaining explicit EmptyCell semantics.

Examples

January 2027 topology:

monthTopology (Year 2027) January MondayStart

Compare week origins:

monthTopology (Year 2027) January MondayStart
monthTopology (Year 2027) January SundayStart

Fixed 42-cell grid:

length (gridCells (buildMonthGrid (Year 2027) January SundayStart
  FixedSixWeeks IncludeAdjacentDates)) == 42

A4 portrait metrics and an undated 6 × 7 planner:

import BetaCalendars.CalendarLayout.Blank
import BetaCalendars.CalendarLayout.Paper

layoutMetrics (defaultLayoutSpec A4 Portrait 6)
blankGrid SixWeeks

Runnable versions of these examples are in examples/.

Computed 2027 topology

The table is derived from the Gregorian calendar model. Weekday labels and row counts are computed, not stored as hand-entered month data. “Printable reference” links point to human-readable Beta Calendars pages.

| Month | Days | First weekday | Last weekday | Monday-first rows | Sunday-first rows | Printable reference | |---|---:|---|---|---:|---:| | January | 31 | Friday | Sunday | 5 | 6 | January Calendar | | February | 28 | Monday | Sunday | 4 | 5 | February Calendar | | March | 31 | Monday | Wednesday | 5 | 5 | March Calendar | | April | 30 | Thursday | Friday | 5 | 5 | April Calendar | | May | 31 | Saturday | Monday | 6 | 6 | May Calendar | | June | 30 | Tuesday | Wednesday | 5 | 5 | June Calendar | | July | 31 | Thursday | Saturday | 5 | 5 | July Calendar | | August | 31 | Sunday | Tuesday | 6 | 5 | August Calendar | | September | 30 | Wednesday | Thursday | 5 | 5 | September Calendar | | October | 31 | Friday | Sunday | 5 | 6 | October Calendar | | November | 30 | Monday | Tuesday | 5 | 5 | November Calendar | | December | 31 | Wednesday | Friday | 5 | 5 | December Calendar |

Human-readable 2027 calendar references

The library calculates calendar topology independently from Gregorian civil rules. The following Beta Calendars pages are human-readable printable references for visual comparison with the computed month structures.

Modules

  • BetaCalendars.CalendarLayout: curated high-level API.
  • .Civil: Gregorian year, month, date and weekday operations.
  • .WeekStart: week-origin rotation and offsets.
  • .Grid: natural/fixed month grids and topology signatures.
  • .Paper: millimetres, paper sizes, margins and layout metrics.
  • .Blank: undated 5 × 7 and 6 × 7 planning grids.
  • .Year2027: computed January–December 2027 fixtures.
  • .Boundary2027: November 2026 through February 2027 fixtures.
  • .Validation: structured validation diagnostics and the 1900–2100 matrix.

Validation

Run cabal check, cabal build all, cabal test all, and cabal haddock all. The deterministic test suite checks every month from 1900 through 2100 for all seven week starts and both grid modes, along with leap-year boundaries, paper-size/orientation combinations, blank grids, and the 2026–2027 boundary.

License

MIT. See LICENSE.