Open
Description
I'm working with times (:grimacing:) and I'd like to go from something like akin to
newtype QuantityOfMinutes = QuantityOfMinutes Natural
to something like
data HoursWithLeftOverMinutes = HoursWithLeftOverMinutes {
hours :: Natural
, leftOverMinutes :: Closed 0 59
}
Whether or not dealing with time is something I should be doing, it struck me that it should be safe to construct a Closed
as the remainder of a division.
divWithRemainder
:: Natural
-- ^ Divisor
-> (Natural, Closed 0 _numerator)
-- ^ Result ^ Remainder
Metadata
Metadata
Assignees
Labels
No labels