ANNOUNCE: time-recurrence-0.1
I'm happy to announce the initial release of time-recurrence: http://github.com/hellertime/time-recurrence A library for generating and inspecting recurring times. This first release is a proof of concept which I am using to find a workable API. There are many features missing at the moment, but since it is my first Haskell library, I was both excited to let it out into the wild and hoping to solicit some feedback on its design. The general direction is to have something that works much like the RRULE portion of the iCalendar (RFC 5545) specification. I have decided avoid strict RFC compliance at this time. Currently the library works like this:
import Data.Time.Recurrence (toUTCTime, withRules, recur, yearly, byMonth, June, July) take 4 . map toUTCTime $ withRules [byMonth [June, July]] $ recur yearly
Which would produce the following (the library defaults to the UTC Epoch as a start date):
[1858-06-17 00:00:00 UTC ,1858-07-17 00:00:00 UTC ,1859-06-17 00:00:00 UTC ,1859-07-17 00:00:00 UTC]
In the future I plan to increase the number of rules, and add functions to test if a time is a valid occurrence of a given rule. I encourage your feedback, suggestions and patches. -Chris
On 2011-05-18 12:45, Chris Heller wrote:
The general direction is to have something that works much like the RRULE portion of the iCalendar (RFC 5545) specification. I have decided avoid strict RFC compliance at this time.
At one point I investigated a really generalised version of this, including an abstract syntax type and perhaps a way of parsing some useful subset of English expressions into it. However I got stuck on such things as "any day after the sixth Sunday of a month" In order to prove that today was not such a day, it would have know that "sixth Sunday of a month" never happens. Simply searching into the past for one would never terminate. Either I would have to restrict the language, or assert the beginning of time (not necessarily a bad solution). Anyway, a possible project for you or someone. -- Ashley Yakeley
participants (2)
-
Ashley Yakeley -
Chris Heller