4 ms·
Another way would be to use return type polymorphism. That way you could have a trait similar to Haskell's "Num a" + "Integral a" with "fromIntegral :: a" and j
by lomnakkus 8y ago
Another way would be to use return type polymorphism. That way you could have a trait similar to Haskell's "Num a" + "Integral a" with "fromIntegral :: a" and just have the parser insert a "fromIntegral" in front of every numeric literal.
I don't know much about Rust, but I'd assume from the discussion that it doesn't support this?
Of course, Haskell's Num is a horribly broken typeclass, so don't do exactly that. :)