3 ms·
The Haskell culture clearly dictates "i = fromString s". And as a consequence, Rust has it standardized as "i = from s".
by marcosdumay 3y ago
The Haskell culture clearly dictates "i = fromString s".
And as a consequence, Rust has it standardized as "i = from s".
- tome 3y agoWhat do you do if you want to disambiguate the return type? I suppose `intFromString` works. I'm not sure what I chose `intOfString`. It's not because I'm French!
- marcosdumay 3y agoYou would declare the type of the returning value: (i :: Int) = fromString s Although once in a while it's useful to make a short synonym for disambiguating the type, x_of_y is certainly not a short synonym, so it's not commonly used.