do i understand you correctly, you’d suggest something like this?
// Clock.res
module type T = {
let now: unit => float
}
// SystemClock.res
let now = () => {
Date.make()->Date.getTime->Float.toInt
}
// Deps.res (composition root)
type t = {clock: module(Clock.T)}
let make = () => {
let clock = module(SystemClock: Clock.T)
{clock: clock}
}
just as an example. am i on the right track?