Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
feature request - Haskell's $ operator #2415
Original bug ID: 2415
Full_Name: Charles Martin
Would love to have Haskell's $ operator added to OCaml. Definining it myself as
doesn't work because of precedence and associativity.
Comment author: ertai
Here is a bit of Camlp4 (compile with the version from CVS) to do that:
$ cat pa_app.ml
$ ocamlc -pp camlp4rf -c -I +camlp4 pa_app.ml
Comment author: jessicah
Can the feature also include defining the actual function/operator, not just the compiler primitive? From what I've been able to see, one hasn't been defined in pervasives.
And whilst (&) is deprecated, I'd recommend against using this, as it conflicts with jocaml.
Is there any reason ocaml can't add the ($) operator (and change the needed precedence/associativity rules)?
Comment author: @garrigue
There is a very good reason not to change the associativity for ($):