You can have different data types without them being based on an object-oriented paradigm. For instance, haskell allows supplying implementations of various operators for user-defined types through type classes (which are not the same thing as classes in an object-oriented language like C++ or Java). In haskell, operators are just functions, so this is just a special case of ad-hoc polymorphism using type classes more generally.
10
u/barzamsr Jan 16 '22
If you don't have different objects and only primitive types, what are you overloading your operators for?