Strongly-typed units and unit literals (e.g. 3mL, 10gal, 15m / 3s = 5m/s)
AFAIK F# has these and that's about it
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)
}