Chris Heller | 3 Aug 2012 05:15
Picon
Gravatar

ANNOUNCE: time-recurrence-0.9.0

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

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

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
library.

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])
(Continue reading)


Gmane