I'm getting a bit lost following precisely what's being proposed. What I'm sort of feeling is that there are two fundamental immutable types needed: Instants and Durations:

  multi sub infix:<-> (Instant, Instant --> Duration)
  multi sub infix:<+> (Instant, Duration --> Instant)
  multi sub infix:<-> (Instant, Duration --> Instant)

, a bunch of implementation-defined constants:

  our Instant $unix_epoch is const = ...;

, plus a bunch of formatting/coercion classes/functions (some of which understand time zones, etc):

  class DateTime is Instant { ... };

In general we wouldn't expose details such as the actual internal implementation epoch; or what datatype is used to store Instants and Durations. One thing we might want is a way to parameterize them to define the precision and range that the user desires for specific concrete objects -- if we could do this using human-friendly units (as postfix functions), that would be good:

  my Duration[ :precision(1 ns), :min(0), :max(10 weeks) ] $delta;

Is this a reasonable summary?

Reply via email to