serokell / o-clock

:hourglass: Type-safe time units in Haskell
Mozilla Public License 2.0
49 stars 6 forks source link

More convenient rounding interface #25

Closed chshersh closed 6 years ago

chshersh commented 6 years ago

In README I wrote:

workWeek :: Natural -> WorkWeek
workWeek = time

completeWeeks = workWeek $ floor $ convertUnit @WorkWeekUnit workHours

Here you can see some redundancy, because I specified WorkWeek twice. This is not satisfying. Problem is in type of floor function:

floor :: (Integral b, RealFrac a) => a -> b

I think we need to do something with it...