default fixity for `quotRem`, `divMod` ??
Bulat Ziganshin
bulat.ziganshin at gmail.com
Tue Jun 19 04:09:16 EDT 2007
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
otoh this relates to my other (too revolutionary) proposal: bind "x+y"
more closely than "x * y" for any (+) and (*), i.e. operation written
without spaces around it should increase its priority by whole 10
points. it will allow significantly decrease amount of parentheses:
f a+b*c x:xs ++ g u&&v record.$field
--
Best regards,
Bulat mailto:Bulat.Ziganshin at gmail.com
More information about the Haskell-prime
mailing list