unisonweb / base

Unison base libraries
https://share.unison-lang.org/@unison/base
18 stars 6 forks source link

Add `averageMonth` and `averageMonths` in the Gregorian calendar #113

Closed chiroptical closed 2 years ago

chiroptical commented 2 years ago

While working on the sql changes, I realized it would be useful to have averageMonth and averageMonths while working with iso8601 time intervals. The time in seconds is equal to the average seconds in a month for the Gregorian calendar.

Unsure if I have properly linked author and license information. Please let me know.

Code review

The changes summarized below are available for you to review, using the following command:

pull-request.load unison.public.base.main chiroptical.public.prs.base._addAverageMonth

Added definitions:

 time.Duration.averageMonth      : Duration (+1 metadata)
 time.Duration.averageMonths     : Int -> Duration (+1 metadata)
 time.Duration.averageMonth.doc  : Doc
 time.Duration.averageMonths.doc : Doc
runarorama commented 2 years ago

The author and license were missing names in base, so I've added those.

Otherwise, looks great!

Merged into main. 🌈⭐