I want to build a function with type signature Time t => t -> Bool
. When looking at the documentation of Data.Time there are several different types that work on time, such as: UTCTime
, LocalTime
, and ZonedTime
, but I find no typeclass that unifies them. Is there any such one or should I treat time just as a Num
? (i.e. a continuum)
The vector-space package has a affine space typeclass.
Diff p
is here the time duration type (which should be an instance of VectorSpace
), and p
is the time point type. You'll need an extra Ord
instance for comparisons.
This provides you with linear interpolation between time points for free.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With