[Haskell] ANNOUNCE: time-recurrence-0.1
Chris Heller
hellertime at gmail.com
Wed May 18 21:45:11 CEST 2011
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
More information about the Haskell
mailing list