default fixity for `quotRem`, `divMod` ??
isaacdupree at charter.net
Tue Jun 19 16:00:54 EDT 2007
-----BEGIN PGP SIGNED MESSAGE-----
Bulat Ziganshin wrote:
> Hello Isaac,
> Monday, June 18, 2007, 9:20:29 PM, you wrote:
>> I was just bitten in ghci by `divMod` being the default infixl 9 instead
>> of the same as `div` and `mod`.
> one of my hard-to-find bugs was exactly in this area: i wrote
> something like x `div` y+1 instead of x `div` (y+1)
> so, based on practical experience, i have opposite proposal: give to
> all `op` lowest precedence (a bit higher than of '$') because it
> complies to its visual effect
I wonder how much code this would break. Maybe we could have a warning
for anything that relies on the default fixity anyway (for things like
x `div` y+1 , that don't give a type error anyway). And it would be
nice if even e.g. `div` had the same precedence as all other `op`s in
existence -- but I'm pretty sure that would break a bunch of code.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
-----END PGP SIGNATURE-----
More information about the Haskell-prime