News for hackers. Stuff that matters.
Re:Seven deadly sins of talking about “types” (2014) by foldr on Saturday December 14, 2019 @04:49AM (#21788680)
The speed is most likely implicitly multiplied by a unit time.
Re:Seven deadly sins of talking about “types” (2014) by thaumasiotes on Saturday December 14, 2019 @08:55AM (#21789495)
That's... exactly the kind of thing a type system is intended to stop you from doing.
Re:Seven deadly sins of talking about “types” (2014) by foldr on Saturday December 14, 2019 @09:54AM (#21789749)
Is it? I think it's fairly uncommon to use types to enforce correct units in calculations, and you need a pretty sophisticated type system to be able to do it.

I'm not saying it's a bad idea, just that it's not really a core application of type systems in real-world programming practice.

Re:Seven deadly sins of talking about “types” (2014) by jsjolen on Saturday December 14, 2019 @10:24AM (#21789892)
Sure, but the general idea that you should disallow undefined operations are a core application of type systems.

You don't need too advanced of a type system to implement what you're talking about. With the caveat that doing it in Java would make the code tedious to write ;-).

Re:Seven deadly sins of talking about “types” (2014) by detaro on Saturday December 14, 2019 @08:58AM (#21789503)
And there's some benefit to forcing you to make that explicit, so the reader doesn't have to assume that "most likely" that was the intended meaning.