by armchairhacker · 3y ago · 0 comments
AFAIK F# has these and that's about it
For instance, the `embedded_time` crate lets you do
200.microseconds()
5.Hz()
https://docs.rs/embedded-time/latest/embedded_time/[1] https://github.com/manifold-systems/manifold/tree/master/man...
with definition like:
val Double.mph: Speed
get() = Speed.mph(this)
data class Speed(val ms: Double)
companion object {
fun mph(mph: Double) = Speed(mph * 1609.344 / 3600.0)
}