
We've found with lens in practice it is actually quite useful to have (&)
bind just a touch tighter than ($), but yes, we do tend to discourage users
from mashing them together:
makeMyLenses = makeLensesWith $
defaultRules & ... & ... & ...
-Edward
On Thu, Oct 10, 2013 at 2:18 PM, David Menendez
On Thu, Oct 10, 2013 at 1:08 PM, Wvv
wrote: We want to combine all of them, like
xs # map $ (+ 3) . snd
And xs $$ map $ (+ 3) . snd - don't look nice.
That's actually a pretty good example of why this is a bad idea. You can't know which argument is being applied first unless you know the precedence levels.
In fact, according to the fixity you initially proposed, that translates to
(xs # map) $ (+3) . snd
The corrected version, xs # (map $ (+3) . snd), isn't much better. Even with the parentheses, it's needlessly confusing. ($) and (#) should never appear in the same expression, or at least they shouldn't apply arguments to the same function. It would be like using (.) and (>>>) together.
-- Dave Menendez
http://www.eyrie.org/~zednenem/ _______________________________________________ Libraries mailing list Libraries@haskell.org http://www.haskell.org/mailman/listinfo/libraries