3 ms·
> Couldn’t the type system still allow using the + operator, but requiring the values on both sides to have the same type? 'course it could, multiple languages
by masklinn 9y ago
> Couldn’t the type system still allow using the + operator, but requiring the values on both sides to have the same type?
'course it could, multiple languages already do that e.g. Rust (https://play.rust-lang.org/?gist=530fa94d3f451e896ac0d3ddeaf66ab1&version=stable https://play.rust-lang.org/?gist=530fa94d3f451e896ac0d3ddeaf...), Haskell (https://repl.it/repls/FrozenBlondUmbrellabird https://repl.it/repls/FrozenBlondUmbrellabird), Swift (https://repl.it/repls/LuckyNaiveBream https://repl.it/repls/LuckyNaiveBream)