New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Syntax for piping into the first argument #2342
Comments
Would this work when the code is compiled with the stock OCaml compiler when compiling to native code (kind of need that for native server-side template generation). /me is really not liking things that are not fully and completely backwards compatible, and not just via a system check |
other potential operators (|#), (|.) empty
|# M.add 1 2
|# M.add 1 2
|# M.reduce 1 2 (fun x -> ...) |
Let's go with |
A couple of things we should check or coordinate:
|
@chenglou the main thing I am worried using (|.) may already be used by existing libs, while (|#) are relatively safe. We can have an option to turn it on/off, but it would be nice to make it unneeded in most cases |
It seems Such options are available:
what do you think? Tend to reserve |
First choice |
|
Let's check for conflict then go with |
Someone should go and clone every ocaml package and grep for |
Isn't it better not to use a valid operator here? I thought that's why |
We will prohibit people using custom defined |. operator, so soundness will be preserved. |
I was thinking in terms of porting ocaml libraries that already have it defined and using it internally in that library |
Yeah. Like @chenglou said we need to figure out if there would be a big impact, i.e. are people actually defining |
I dont think the operator is used in the wild, but I will send an email to caml-list in next release |
What about adding a flag in It's a really big change and there's no going back, that's why I'm really hesitant about this. If a really influential ocaml library comes around in the future and happens to use |
I just downloaded all 1805 packages from OPAM and ran
|
@utkarshkukreti thanks a lot! This community is crazy great |
There is a paradox here, if we allow such work around, then people would use it. We can always make it configurable in the future if something can not be fixed. But I think it is better to make it strict here, so people would adopt such convention |
One other thing I was wondering about -- how's the interop with the existing pipe operator? target
|. targetFirstFn
|. targetFirstFn2(foo)
|> targetLastFn(bar)
|. targetFirstFn3 |
it should just work as it is. We did not change the semantics of existing pipe operator |
Stale |
relevant reasonml/reason#1452
data #. add x y (* translated --> *) add data x y
The text was updated successfully, but these errors were encountered: