[Haskell] ANNOUNCE: time-recurrence-0.2
Chris Heller
hellertime at gmail.com
Wed May 25 04:36:57 CEST 2011
Hot on the heels of the 0.1 release of time-recurrence:
http://hackage.haskell.org/package/time-recurrence
comes your favorite recurring time library: time-recurrence-0.2.
At this point the library can generate many of the examples given in
section 3.8.5.3 of the iCalendar RFC.
The interface has been reworked to make things more concise, an example:
> -- Generate every 10 days, 5 occurrences
> startDate = utcGregorianWithTime 1997 9 2 14 0 0 -- Y M D HH MM SS
> map moment $ take 5 $ recurBy 10 [] $ Daily startDate
> [1997-09-02 14:00:00 UTC
> ,1997-09-12 14:00:00 UTC
> ,1997-09-22 14:00:00 UTC
> ,1997-10-02 14:00:00 UTC
> ,1997-10-12 14:00:00 UTC]
I'm still tweaking the main data structures so things are very
unstable right now.
There is no support for operators like the iCalendar BYSETPOS, which
would allow you to generate "the 30th of the month in June if it is a
Week Day otherwise the last Week Day in June".
For the future I also am looking at how to enforce some of the more
esoteric iCalendar rules, such as using BYMONTHDAY in a MONTHLY
frequency when also using BYDAY. Since I am not being strict I can
simply punt on the matter, but it would be interesting to support such
dependencies.
As always I encourage all feedback, suggestions and pull requests.
-Chris
More information about the Haskell
mailing list