[Haskell-cafe] ANNOUNCE: time-recurrence-0.5.2

Chris Heller hellertime at gmail.com
Tue Jun 7 21:09:59 CEST 2011


I'm happy to announce the first fully functional release of time-recurrence:

    http://hackage.haskell.org/package/time-recurrence

As of version 0.5.2, the library is now powerful enough to express all
recurring dates which can be specified via the iCalendar RFC.

An example:

Generate the 15th and the 30th of the month, but only during the work week:

    > jan2011 = ptime "Sat, 01 Jan 2011 00:00:00 -0400"
    > jan2012 = ptime "Sun, 01 Jan 2012 00:00:00 -0400"
    > takeWhile (<= jan2012) $ recur monthly `starting` jan2011 $
    >   enumDays [15,30] >=>
    >   filterWeekDays [Monday .. Friday]

    [2011-02-15 04:00:00 UTC
    ,2011-03-15 04:00:00 UTC, 2011-03-30 04:00:00 UTC
    ,2011-04-15 04:00:00 UTC
    ,2011-05-30 04:00:00 UTC
    ,2011-06-15 04:00:00 UTC, 2011-06-30 04:00:00 UTC
    ,2011-07-15 04:00:00 UTC
    ,2011-08-15 04:00:00 UTC, 2011-08-30 04:00:00 UTC
    ,2011-09-15 04:00:00 UTC, 2011-09-30 04:00:00 UTC
    ,2011-11-15 04:00:00 UTC, 2011-11-30 04:00:00 UTC
    ,2011-12-15 04:00:00 UTC, 2011-12-30 04:00:00 UTC
    ]

As always I encourage feedback, criticism, suggestions and pull requests.

-Chris



More information about the Haskell-Cafe mailing list