
On Saturday 02 April 2005 22:29, Peter Hercek wrote:
What is $ function good for?
Mostly for avoiding parentheses. $ is right associative and has lowest precedence, whereas normal application is left associative and binds most tightly: f $ g $ h x === f ( g ( h x ) ) There are more advanced uses of $ but I'll let others elaborate on that. Ben

At 10:56 PM +0200 4/2/05, Benjamin Franksen wrote:
On Saturday 02 April 2005 22:29, Peter Hercek wrote:
What is $ function good for?
Mostly for avoiding parentheses. $ is right associative and has lowest precedence, whereas normal application is left associative and binds most tightly:
f $ g $ h x === f ( g ( h x ) )
There are more advanced uses of $ but I'll let others elaborate on that.
Ben
The other main use is to have a name for function application. For example, zipWith ($) [sin, cos, tan] [0, 1, 2] Dean
participants (3)
-
Benjamin Franksen
-
Dean Herington
-
Peter Hercek