on

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

on

Ivan Uemlianin
Dear All

During some recent discussion about different ways of sorting a list by
some comparison function, one of the methods suggested was like this:

    sortByFunc = sortBy (compare `on` func)

Now, I can imagine how this works, and I don't want to discuss the
efficiency of this implementation (I imagine it's not "Schwartzian", for
example;).  I know what the backticks do (allow infix use of a function).

My question is: what is "on"?

I'm afraid I haven't been able to find anything about this, no doubt
because of all the false positives coming up in searches.  Please could
someone tell me its official title, or where I could find it in the docs?

Thanks and best wishes

Ivan


--
============================================================
Ivan A. Uemlianin
Speech Technology Research and Development

                    [hidden email]
                     www.llaisdy.com
                         llaisdy.wordpress.com
                     www.linkedin.com/in/ivanuemlianin

    "Froh, froh! Wie seine Sonnen, seine Sonnen fliegen"
                     (Schiller, Beethoven)
============================================================

Reply | Threaded
Open this post in threaded view
|

on

Erlend Hamberg
2009/6/26 Ivan Uemlianin <[hidden email]>:
> My question is: what is "on"?
> I'm afraid I haven't been able to find anything about this, no doubt because
> of all the false positives coming up in searches.

http://www.haskell.org/hoogle/?hoogle=on

--
Erlend Hamberg
[hidden email]
Reply | Threaded
Open this post in threaded view
|

on

Ivan Uemlianin
Erlend Hamberg wrote:
> 2009/6/26 Ivan Uemlianin <[hidden email]>:
>  
>> My question is: what is "on"?
>> I'm afraid I haven't been able to find anything about this, no doubt because
>> of all the false positives coming up in searches.
>>    
>
> http://www.haskell.org/hoogle/?hoogle=on
>  
Wow that was fast!

Thanks, I hadn't tried Hoogle before and what I needed was the top hit:

   
http://haskell.org/ghc/docs/latest/html/libraries/base/Data-Function.html#v%3Aon

Ivan

--
============================================================
Ivan A. Uemlianin
Speech Technology Research and Development

                    [hidden email]
                     www.llaisdy.com
                         llaisdy.wordpress.com
                     www.linkedin.com/in/ivanuemlianin

    "Froh, froh! Wie seine Sonnen, seine Sonnen fliegen"
                     (Schiller, Beethoven)
============================================================