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

Chris Heller hellertime at gmail.com
Fri Aug 3 05:15:58 CEST 2012

I am happy to announce a new version of time-recurrence, a library of
functions for generating recurring sequences of dates:


New in version 0.9.0 is a redesigned top layer API. Previously
recurrences were described by combining generating functions to get
the desired effect.

This was quite functional but had the drawback that a recurrence was
difficult to persist outside of the Haskell run-time. As of version
0.9.0 this limitation is no more. Now the actual recurrence rule is
defined by combining types into a data structure which can either be
persisted (and later read back) or evaluated into a function to
generate dates. This also means that the type system now enforces
correct rule creation!

Additionally some convenience functions are available to construct the
recurrence rule in a format familiar to previous users of this

Here is a familiar example:

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

    > jan2011 = ptime "Sat, 01 Jan 2012 00:00:00 -0400"
    > jan2012 = ptime "Sun, 01 Jan 2013 00:00:00 -0400"
    > takeWhile (<= jan2013) $ starting jan2012 $
    >   recur monthly
    >   >==> enum (Days [15,30])
    >   >==> filter (WeekDays [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

On the road to version 1.0, I plan to add another type layer which
strictly enforces RFC 5545 section 3.3.10.

As always I encourage feedback, criticism, suggestions and pull
requests. I would especially welcome any type system experts feedback:
quite a few GHC extensions needed to be turned on to get this to work.


More information about the Haskell-Cafe mailing list