(no title)
ianhorn | 4 years ago
If you meant a numeric single type class, like haskell's Num, I think it's a great option. If you mean a single numeric type, like javascript, it unfortunately leads to a bunch of issues. Integers and floats really are both necessary very frequently. For example floats to represent something like speed, and ints to represent your bank balance. And you need different sizes of them (like float32 vs float64) are still necessary in a ton of applications, so you'll need them eventually if you want the language/numerics library to be truly general purpose.
It's also a huge convenience to be able to apply e.g. `+` to arrays as well as numbers and other polymorphism niceties.
No comments yet.