Flipped function application

Edward Kmett ekmett
Fri Oct 11 13:15:55 UTC 2013


Daniel,

I'd be willing to risk the pain of switching to = for the functional
versions of the functions rather than ~ if a majority of users wanted it
that way.

Feel free to open a ticket on the issue on github.com/ekmett/lens/issues if
you feel strongly and let folks fight it out there. ;)

I confess it bugs me a fair bit too, as I almost never use the state
versions of things. The convention predates the existence of (&), which
made it much easier to write functional lens code.

-Edward



On Fri, Oct 11, 2013 at 6:34 AM, Daniel Trstenjak <
daniel.trstenjak at gmail.com> wrote:

>
> > A year ago, I might have opposed the proposal altogether, but
> > diagrams has convinced me that it's quite useful.
>
> It's almost the same for myself. I thought that I should dislike the
> lens library, but after being able to write code like this:
>
>  grid & atCoord oldCoord . entity .~ NoEntity
>       & atCoord newCoord . entity .~ RobotEntity rob
>
>
> And I think it would read even better like this:
>
>  grid # atCoord oldCoord . entity .= NoEntity
>       # atCoord newCoord . entity .= RobotEntity rob
>
>
> Yes, having to use '~' instead of '=' is the thing that currently
> bothers me the most about the lens library, because IMHO the usage in
> the State-Monad should be the lesser used one, should be the less
> encouraged one, and the "nicer" operator should be reserved for the
> more common case.
>
> Being able to use '.=' in the State-Monad seems mostly to be nice for
> writing tutorials =).
>
>
> Greetings,
> Daniel
> _______________________________________________
> 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/20131011/dad8ed6a/attachment.html>




More information about the Libraries mailing list