logo       
Google Custom Search
    AddThis Social Bookmark Button

function application operator?: msg#00065

Subject: function application operator?
I was reading the Haskell wiki page (via Lambda the Ultimate) and came 
across this page:
http://www.haskell.org/hawiki/PipeliningFunctions

I don't think Ocaml has a function application operator- not that one is 
hard to write:
let ( $ ) : ('a -> 'b) -> 'a -> 'b = fun f x -> f x

or even more simply:

let ( $ ) f x = f x

Likewise, functional composition is fairly trivial to implement:

let ( $. ) f g x = f (g x)

I'm not 100% sure I see the purpose of having these operators- I'd just 
use parens, and instead of writting:
    foo $. bar $. bang $ x
I'd write
    foo (bar (bang x))
which does the same bleeding thing.  But I thought I'd throw the idea out 
to the listmind to see if we wanted to make things friendlier for any 
Haskel programmers who come our way?

Brian




-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf



Try Searching:
servers, voip, java, networking, microsoft ...
<Prev in Thread] Current Thread [Next in Thread>