bos / pool

A high-performance striped resource pooling implementation for Haskell
Other
112 stars 59 forks source link

Use DiffTime instead of NominalDiffTime #27

Open nikita-volkov opened 8 years ago

nikita-volkov commented 8 years ago

The NominalDiffTime type is intended for manipulation of universal dates, and it does not always represent the same interval of time. The timeout values on the other hand require exactly an interval of time, which is the case in this library. Such values should be represented by the DiffTime type.

BardurArantsson commented 8 years ago

Why use either? Why not just specify using a simple Word64? Seems rather excessive to incur a dependency for just (Nominal)DiffTime?

(I'm obviously assuming that there's some way of getting at the system's monotonic clock.)

RobertFischer commented 7 years ago

What's the issue with a dependency in order to be more expressive in your type system by using a de facto standard?

BardurArantsson commented 7 years ago

How is it more expressive? AFAICT (Nominal)DiffTime even allow negative values -- which is utterly nonsensical for timeouts.

(Also, there are other time libraries, though they usually themselves end up having to depend on time itself. Given the above I just don't it makes sense to have the dependency. That's all.)