I'm in a migration mood, looking at migrating @Ian McLerran's roc-isodate's library. Hopefully, it shouldn't take too long, but I do have one question: how should I migrate parametrized modules? For example:
# Now.roc
module { now!, now_to_nanos } -> [date_time!, date!, time!]
and:
import dt.Now {
now!: Utc.now!,
now_to_nanos: Utc.to_nanos_since_epoch,
}
I guess the new approach is simply to define an opaque type like this:
Now :: { now! : ({} => Now), now_to_nanos: (Now -> U64) }.{ ... }
which can then be used like this:
import dt.Now
now = Now.create({now!: Utc.now!, now_to_nanos: Utc.to_nanos_since_epoch))
datetime = now.date_time!({})
Does this look good to you?
Seems logical to me
Thanks @Anton
Mmh, I just noticed that roc-isodate depends on two libraries:
They are only used for a few functions, so I think I'll just reimplement them locally rather than port two more libraries.
From rutils:
split_at_indicessplit_with_delimsunwrappad_left_asciiThe roc-tinyparse library is only used to implement parse_frac_fmt so I think I'll use roc-parser instead since I just migrated it.
Last updated: Jul 23 2026 at 13:15 UTC