On Sun, Jun 21, 2026 at 3:57 PM Tim Düsterhus <[email protected]> wrote:

> Hi
>
> On 6/21/26 11:18, ignace nyamagana butera wrote:
> > Indeed Duration::divmod is the way forward just wondering about  the
> return
> > type. Should it be an array or a immutable DTO with .2 properties
> quotient
> > and remainder?
>
> For bcdivmod it was a deliberate choice to make the result a 2-tuple,
> with the expectation that array destructuring is used to consume the
> return value.
>
> Operation-wise I would agree that “div mod” is the correct thing to do,
> but I don't think that calling Duration/Duration->(int, Duration)
> literally divmod is an intuitive API when there's also the other
> division that does Duration/int->Duration.
>
> Best regards
> Tim Düsterhus
>

Then maybe we could go with chunkedBy or decomposedBy ?
These are just propositions, naming things is hard

Best regards
Ignace

Reply via email to