Author: Tom Sydney Kerckhove <syd@cs-syd.eu>
Committer: Tom Sydney Kerckhove <NorfairKing@users.noreply.github.com>
ical-recurrence: express recurrence over a parameterised component Nothing here is red. This is a pure refactor: every .occ and .res golden file is byte-identical, and the only new tests are genValidSpecs for the new types. This is the groundwork for handling RECURRENCE-ID. A component with a RECURRENCE-ID replaces the instance it names rather than adding an occurrence beside it, so the occurrences of one component depend on the other components sharing its UID. No function that takes a single component can be correct about that, which is why the old single-component entry points go away rather than gaining a fix: recur :: Day -> event -> R (Set event) took one component and rewrote its DTSTART, and recurEvents :: Day -> RecurringEvent -> R (Set EventOccurrence) computed one component's own expansion under a name that claimed to compute a recurrence set. The expansion itself is still needed, so it survives as 'expandRecurring', which says what it does. Recurrence also applies to VTODO and VJOURNAL, not only VEVENT. RFC 5545 gives all three the same recurrence properties, and section 3.8.4.4 says RECURRENCE-ID identifies an instance of a "VEVENT, VTODO, or VJOURNAL". The only thing that differs is how the end of an instance is spelled: DTEND for VEVENT, DUE for VTODO, and VJOURNAL has none. 'RecurrenceEnd' is that shared spelling, so a VTODO's DUE is not typed as a DTEND, and the three projections 'eventRecurring', 'todoRecurring' and 'journalRecurring' are where the difference lives. 'Recurring', 'Occurrence' and 'Resolved' are parameterised over the component so that one recurrence implementation serves all three, and so that a caller which has already narrowed a VEVENT down to what it cares about can still recur it. The Functor instances are how it swaps its own type in. 'HasRecurrence' is gone: a class over three known types buys nothing that three functions do not, and 'makeOccurrence' existed only to hand back a component the calendar never contained. ICal.Recurrence.Class held the class, so it is renamed to ICal.Recurrence.Types, which is what it now holds.
| Time to Start | Worker time | Duration | Time to finish | Idle | |
| Config | 2s | 1s | 1s | 3s | 2s |
| Eval | 7s | 9s | 9s | 17s | 3s |
| Build | 16s | 0s | 0s | 16s | 0s |
| Suite | 2s | 11s | 15s | 17s | 5s |