Proposal: Add (&) to Data.Function

Edward Kmett ekmett at gmail.com
Tue Nov 20 20:05:55 CET 2012


At this time I haven't switched the %~ operators from %. I will miss the
consistency that operator= or operator~ applies the operator to the target
of the lens, like how += applies (+) to the target of an l-value, in this
case, but i think it'd be silly to try too hard to be consistent across
every use of % in lens and that %= for mod-equals still reads better than
&=, which _is_ used in lens for bitwise .&. in data.bits.lens mosty because
.&.= is silly looking ;)

-Edward

On Tue, Nov 20, 2012 at 1:46 PM, John Wiegley <johnw at fpcomplete.com> wrote:

> >>>>> Edward Kmett <ekmett at gmail.com> writes:
>
> > We had switched to % from (|>) to be consistent with the other (+=) (*=)
> > operators where (%=) was being read as 'mod-equals' as a bit of a pun,
> and
> > could be seen as the application of the % operator to the target.
>
> Yes, a strong positive in favor of & of |> is that it allows the lens
> library
> to offer the highly useful variants &= and &~, which have obvious (and
> related) meanings to someone using lens.  |>= and |>~ would get a bit
> awkward
> in comparison.
>
> --
> John Wiegley
> FP Complete                         Haskell tools, training and consulting
> http://fpcomplete.com               johnw on #haskell/irc.freenode.net
>
> _______________________________________________
> Libraries mailing list
> Libraries at haskell.org
> http://www.haskell.org/mailman/listinfo/libraries
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.haskell.org/pipermail/libraries/attachments/20121120/eae5453e/attachment.htm>


More information about the Libraries mailing list