package lunar
Install
dune-project
Dependency
Authors
Maintainers
Sources
sha256=f158deac67b864f3edd7d1242b3340a0f218d4465b9e4108501a02197594d0f9
sha512=acf9a3ea508c3df2351aec6ea8299583be128f02d2d891ab82a2999ad6ba00c967962ede7d96782c27a7edcb7f78db08380293a8bf044a567a749872bbc417a8
doc/lunar/Lunar/index.html
Module LunarSource
Lunar is a minimal date and time library, based primarily on a proleptic Gregorian calendar, that focuses on simple operations. Its development is needs-driven, meaning that the library is open to contributions that add use cases not initially considered.
In particular, the library allows you to work with Time objects (a specific hour of the day), Date objects (a specific day of the year), Datetime objects (a combination of a Time and a Date), and Zoned_datetime objects (a Datetime associated with a Timezone).
The code (and the algorithms used) is designed to be as simple as possible and easy to extend (without any particular concern for performance... sorry).
Components
Describes the low-level components used as utilities for describing dates.
Era identifies the historical period relative to year numbering. In the Gregorian/ISO calendar there are two eras: BCE and CE. Since Lunar just support dates between the years 0000 (in an astronomic sense), BCE is probably never used.
Absolute elements
All objects that are not associated with a time zone.
Relative elements
Objects associated with a time zone.
Describes the offset of a time zone, used to describe time-zone datetime values.
A Datetime.t associated with a Timezone.t.
Resolution and Duration
The resolution allows you to truncate dates (and more). And durations are a low-level representation of a number of seconds.
Describes a resolution that allows, among other things, dates to be truncated. Since negative resolutions produce strange results, they are always converted to their absolute values.
Describes a duration in seconds (Lunar is essentially a Calendar library, so greater precision does not seem particularly useful). This is the most primitive type in the library, and the API exposes minimal set of arithmetic operations.
Ranges
Provides a generic way to describe orderable and iterable ranges.
The Range module allows you to create intervals between comparable data points (implementing Sigs.COMPARABLE).
Reusable signatures
module Sigs : sig ... endSet of reusable signatures for sharing behaviors, among other things.