- Add project scaffolding (dune, dune-project, opam, .ocamlformat) - Implement basic parsing and handling of iCalendar events - Add event predicates for common event types (all-day, timed, recurrence, exceptions) - Add transformation logic to map iCalendar events to Remind format (stub implementation) - Provide utilities for extracting event details and converting dates/times - Set up executable entrypoint and command-line interface using Cmdliner - Include Remind event type definitions and helpers
16 lines
564 B
OCaml
16 lines
564 B
OCaml
let default_implementation = Remind.Omit (Ptime.epoch |> Ptime.to_date)
|
|
|
|
let remind_of_event (ev : Icalendar.event) : Remind.event =
|
|
let found =
|
|
ListLabels.fold_left ~init:[] EventPredicates.all_predicates ~f:(fun acc (pred, desc) ->
|
|
if pred ev then desc :: acc else acc)
|
|
|> List.rev
|
|
in
|
|
if List.length found > 0
|
|
then begin
|
|
Printf.printf " ⇒ matches these predicates:\n";
|
|
List.iter (fun d -> Printf.printf " - %s\n" (EventPredicates.show_event_description d)) found;
|
|
Printf.printf "\n"
|
|
end;
|
|
default_implementation
|