BetaCalendars.GridAlgebra
- Package
- purescript-betacalendars-grid-algebra
- Repository
- mateopedersen/purescript-betacalendars-grid-algebra
Curated entry point to civil-date, week-origin, grid, paper, and blank surface APIs. Each domain module also remains available for focused use.
Project context: Beta Calendars.
Re-exports from BetaCalendars.GridAlgebra.Blank
#compareBlankLayouts Source
compareBlankLayouts :: LayoutSpec -> LayoutSpec -> Either LayoutError { cellAreaDifference :: Number, first :: LayoutMetrics, second :: LayoutMetrics }Compare the per-cell area of two valid blank layouts.
#blankWritingArea Source
blankWritingArea :: LayoutMetrics -> NumberTotal modeled area available in the grid cells.
#blankLayout Source
blankLayout :: LayoutSpec -> Either LayoutError LayoutMetricsCompute printable geometry for an undated grid.
#blankCellArea Source
blankCellArea :: LayoutMetrics -> NumberArea of one blank cell in square millimeters.
Re-exports from BetaCalendars.GridAlgebra.Civil
#DayOfMonth Source
#previousDate Source
previousDate :: CivilDate -> Maybe CivilDateMove one civil day backward; returns Nothing before 0001-01-01.
#monthNumber Source
monthNumber :: Month -> IntOne-based month number.
#monthFromNumber Source
monthFromNumber :: Int -> Maybe MonthConvert a one-based month number into its Gregorian month.
#isLeapYear Source
isLeapYear :: Year -> BooleanGregorian leap-year rule, including century and 400-year exceptions.
#dayOfMonthValue Source
dayOfMonthValue :: DayOfMonth -> IntThe numeric day of month.
#dateDay Source
dateDay :: CivilDate -> DayOfMonthThe day component of a date.
Re-exports from BetaCalendars.GridAlgebra.Grid
#TopologySignature Source
newtype TopologySignatureDescriptive signature of a month's shape under a selected week origin. This package-specific tuple is useful for comparing shapes; it is not an external calendar standard.
Instances
#GridMode Source
#GridCell Source
type GridCell = { date :: Maybe CivilDate, index :: Int, relation :: CellRelation }One row-major cell in a month grid.
#CellRelation Source
#AdjacentPolicy Source
data AdjacentPolicyWhether dates outside the displayed month are rendered in spare cells.
Constructors
Instances
#topologySignature Source
topologySignature :: MonthTopology -> WeekStart -> TopologySignatureCreate this package's descriptive topology tuple.
#monthTopology Source
monthTopology :: Year -> Month -> WeekStart -> MonthTopologyCompute month topology without allocating its cells.
#currentMonthDays Source
currentMonthDays :: MonthGrid -> IntThe number of current-month cells in a grid.
Re-exports from BetaCalendars.GridAlgebra.Paper
#PaperSize Source
data PaperSizeStandard ISO and US paper formats, or a custom width and height.
Constructors
Instances
#Millimeters Source
#Margins Source
type Margins = { bottom :: Millimeters, left :: Millimeters, right :: Millimeters, top :: Millimeters }Four non-negative page margins.
#LayoutSpec Source
type LayoutSpec = { columns :: Int, margins :: Margins, notesHeight :: Millimeters, orientation :: Orientation, paper :: PaperSize, rows :: Int, titleHeight :: Millimeters, weekdayHeaderHeight :: Millimeters }Input parameters for a printable grid model.
#LayoutMetrics Source
type LayoutMetrics = { cellArea :: Number, cellHeight :: Millimeters, cellWidth :: Millimeters, gridHeight :: Millimeters, gridWidth :: Millimeters, pageHeight :: Millimeters, pageWidth :: Millimeters, printableHeight :: Millimeters, printableWidth :: Millimeters, writingArea :: Number }Derived page and cell geometry.
#LayoutError Source
data LayoutErrorFailures that prevent a physically meaningful grid calculation.
Constructors
Instances
#paperDimensions Source
paperDimensions :: PaperSize -> Orientation -> { height :: Number, width :: Number }Dimensions in the requested orientation. Letter and Legal are the US nominal dimensions in millimeters.
#millimeters Source
millimeters :: Number -> Maybe MillimetersConstruct a non-negative finite millimeter value.
#millimeterValue Source
millimeterValue :: Millimeters -> NumberRead the numeric millimeter measurement.
#layoutMetrics Source
layoutMetrics :: LayoutSpec -> Either LayoutError LayoutMetricsCalculate layout geometry after validating all reserved areas and shape.
#defaultMargins Source
defaultMargins :: MarginsCommon model margins used in examples: 10 mm on each side.
Re-exports from BetaCalendars.GridAlgebra.WeekStart
#WeekStart Source
#weekdayIndex Source
weekdayIndex :: Weekday -> IntMonday is 0, Tuesday is 1, and Sunday is 6.
#weekStartWeekday Source
weekStartWeekday :: WeekStart -> WeekdayThe weekday corresponding to a week-start setting.
#rotateWeekOrigin Source
rotateWeekOrigin :: WeekStart -> Int -> WeekdayRotate a week origin by an arbitrary number of days, wrapping every seven.
#relativeWeekdayIndex Source
relativeWeekdayIndex :: WeekStart -> Weekday -> IntThe zero-based column of a weekday under the supplied week origin.
#offsetFromWeekStart Source
offsetFromWeekStart :: WeekStart -> Weekday -> IntNumber of leading grid cells before the first day of a month.
#allWeekdays Source
allWeekdays :: Array WeekdayEvery weekday in Monday-first index order.
#allWeekStarts Source
allWeekStarts :: Array WeekStartEvery supported week origin in weekday order.
- Modules
- BetaCalendars.
GridAlgebra - BetaCalendars.
GridAlgebra. Blank - BetaCalendars.
GridAlgebra. Boundary2027 - BetaCalendars.
GridAlgebra. Civil - BetaCalendars.
GridAlgebra. Grid - BetaCalendars.
GridAlgebra. Paper - BetaCalendars.
GridAlgebra. Validation - BetaCalendars.
GridAlgebra. WeekStart - BetaCalendars.
GridAlgebra. Year2027