[Haskell-beginners] "Shortcut" for f (g x) (g x)

Jeffrey Brown jeffbrown.the at gmail.com
Mon Dec 4 17:31:40 UTC 2017


This led me to look up the definition of on
<http://hackage.haskell.org/package/base-4.10.0.0/docs/src/Data.Function.html#on>
and
discover that punctuation can be used as a variable name for an operator!

On Mon, Dec 4, 2017 at 11:51 AM, Baa <aquagnu at gmail.com> wrote:

> Oh, yes! Exactly, thanks to all!!
>
> > Hi!
> >
> > I think you're looking for Data.Function.on:
> > http://hackage.haskell.org/package/base-4.10.0.0/docs/
> Data-Function.html#v:on
> >
> > On 04/12/2017, Baa <aquagnu at gmail.com> wrote:
> > > Hello, All!
> > >
> > > Does Haskell have some "short-form" for such call: `f (g x) (g x)`,
> > > for example:
> > >
> > >   compare (snd x) (snd x)
> > >
> > > Looks like combinatory logic or `ap` but not exactly...
> > >
> > > ===
> > > Best regards, Paul
> > > _______________________________________________
> > > Beginners mailing list
> > > Beginners at haskell.org
> > > http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
> > >
> > _______________________________________________
> > Beginners mailing list
> > Beginners at haskell.org
> > http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
>
> _______________________________________________
> Beginners mailing list
> Beginners at haskell.org
> http://mail.haskell.org/cgi-bin/mailman/listinfo/beginners
>



-- 
Jeff Brown | Jeffrey Benjamin Brown
Website <https://msu.edu/~brown202/>   |   Facebook
<https://www.facebook.com/mejeff.younotjeff>   |   LinkedIn
<https://www.linkedin.com/in/jeffreybenjaminbrown>(spammy, so I often miss
messages here)   |   Github <https://github.com/jeffreybenjaminbrown>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/beginners/attachments/20171204/9a3f5a5f/attachment.html>


More information about the Beginners mailing list